From d565fb8b0638693f02c8c2711d8a510f80c0884b Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Mon, 6 Aug 2018 22:46:36 +0200 Subject: [PATCH] Added webkit setting for file uri handling. --- doc/vimb.1 | 14 +++++++++++++- src/setting.c | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/vimb.1 b/doc/vimb.1 index dd76cc7..11bd3fd 100644 --- a/doc/vimb.1 +++ b/doc/vimb.1 @@ -967,13 +967,25 @@ The search completion allows a filtered list of already done searches. This completion starts by `/` or `?` in inputbox and performs a prefix comparison for further typed chars. .SH SETTINGS -All settings listed below can be set with the `:set' command. See \fBSettings\fP under \fBCOMMAND MODE\fP for syntax. +All settings listed below can be set with the `:set' command. +See \fBSettings\fP under \fBCOMMAND MODE\fP for syntax. .TP .B accelerated-2d-canvas (bool) Enable or disable accelerated 2D canvas. When accelerated 2D canvas is enabled, WebKit may render some 2D canvas content using hardware accelerated drawing operations. .TP +.B allow-file-access-from-file-urls (bool) +Indicates whether file access is allowed from file URLs. +By default, when something is loaded using a file URI, cross origin requests +to other file resources are not allowed. +.TP +.B allow-universal-access-from-file-urls (bool) +Indicates whether or not JavaScript running in the context of a file scheme +URL should be allowed to access content from any origin. +By default, when something is loaded in a using a file scheme URL, access to +the local file system and arbitrary local storage is not allowed. +.TP .B caret (bool) Whether to enable accessibility enhanced keyboard navigation. .TP diff --git a/src/setting.c b/src/setting.c index cc42ca0..d6c69b6 100644 --- a/src/setting.c +++ b/src/setting.c @@ -81,6 +81,12 @@ void setting_init(Client *c) /* TODO use the real names for webkit settings */ i = 14; setting_add(c, "accelerated-2d-canvas", TYPE_BOOLEAN, &off, webkit, 0, "enable-accelerated-2d-canvas"); +#if WEBKIT_CHECK_VERSION (2, 10, 0) + setting_add(c, "allow-file-access-from-file-urls", TYPE_BOOLEAN, &off, webkit, 0, "allow-file-access-from-file-urls"); +#endif +#if WEBKIT_CHECK_VERSION (2, 14, 0) + setting_add(c, "allow-universal-access-from-file-urls", TYPE_BOOLEAN, &off, webkit, 0, "allow-universal-access-from-file-urls"); +#endif setting_add(c, "caret", TYPE_BOOLEAN, &off, webkit, 0, "enable-caret-browsing"); setting_add(c, "cursiv-font", TYPE_CHAR, &"serif", webkit, 0, "cursive-font-family"); setting_add(c, "default-charset", TYPE_CHAR, &"utf-8", webkit, 0, "default-charset"); -- 2.20.1