[hackers] [surf][patch] make surf view local HTML files instead of downloading them
Hi folks,
I'm wondering whether surf should open local html files (file://*.html) as web pages instead of calling the download fn on them (which is the current behavior as of d068a3878). Could be useful for viewing e.g. local HTML documentation.
Attached is the patch that worked for me.
One possible drawback in this patch is that I'm making a guess based only on URI scheme (file://) and the extension (.htm/.html). It would be more correct to determine the actual MIME type of the file to open, but I barely know webkit2 api. I tried calling webkit_uri_response_get_mime_type on local HTML but it returns "application/x-zerosize" not "text/html".
Thanks
Oleg
Received on Thu Jun 20 2019 - 22:26:32 CEST
This archive was generated by hypermail 2.3.0
: Thu Jun 20 2019 - 22:36:23 CEST