Use ephemeral webview if incognito option is used #562
authorDaniel Carl <danielcarl@gmx.de>
Fri, 14 Jun 2019 23:28:48 +0000 (01:28 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 14 Jun 2019 23:28:48 +0000 (01:28 +0200)
Also removed obsolete 'private-browsing' setting.

CHANGELOG.md
doc/vimb.1
src/main.c
src/setting.c

index 6da8f50..5ae129d 100644 (file)
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 ### Changed
 ### Fixed
 ### Removed
+* setting `private-browsing` was removed in favor of `--incognito` option.
 
 ## [3.4.0] - 2019-03-26
 ### Added
@@ -241,7 +242,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
   cookie file
 * Fixed none POSIX `echo -n` call
 
-[Unreleased]: https://github.com/fanglingsu/vimb/compare/3.3.0...master
+[Unreleased]: https://github.com/fanglingsu/vimb/compare/3.4.0...master
 [3.4.0]: https://github.com/fanglingsu/vimb/compare/3.3.0...3.4.0
 [3.3.0]: https://github.com/fanglingsu/vimb/compare/3.2.0...3.3.0
 [3.2.0]: https://github.com/fanglingsu/vimb/compare/3.1.0...3.2.0
index 11b783f..f4d66f2 100644 (file)
@@ -1257,12 +1257,6 @@ when the user is not connected to the network.
 .B print-backgrounds (bool)
 Whether background images should be drawn during printing.
 .TP
-.B private-browsing (bool)
-Whether to enable private browsing mode.
-This suppresses  printing of messages into JavaScript Console.
-At the time this is the only way to force WebKit to
-not allow a page to store data in the windows sessionStorage.
-.TP
 .B plugins (bool)
 Determines whether or not plugins on the page are enabled.
 .TP
index 6eb69dd..3d7b8ca 100644 (file)
@@ -1823,7 +1823,11 @@ static void vimb_setup(void)
     /* Use seperate rendering processed for the webview of the clients in the
      * current instance. This must be called as soon as possible according to
      * the documentation. */
-    ctx = webkit_web_context_get_default();
+    if (vb.incognito) {
+        ctx = webkit_web_context_new_ephemeral();
+    } else {
+        ctx = webkit_web_context_get_default();
+    }
     webkit_web_context_set_process_model(ctx, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
     webkit_web_context_set_cache_model(ctx, WEBKIT_CACHE_MODEL_WEB_BROWSER);
 
index b73bc18..cc67377 100644 (file)
@@ -116,7 +116,6 @@ void setting_init(Client *c)
     setting_add(c, "plugins", TYPE_BOOLEAN, &on, webkit, 0, "enable-plugins");
     setting_add(c, "prevent-newwindow", TYPE_BOOLEAN, &off, internal, 0, &c->config.prevent_newwindow);
     setting_add(c, "print-backgrounds", TYPE_BOOLEAN, &on, webkit, 0, "print-backgrounds");
-    setting_add(c, "private-browsing", TYPE_BOOLEAN, &off, webkit, 0, "enable-private-browsing");
     setting_add(c, "sans-serif-font", TYPE_CHAR, &"sans-serif", webkit, 0, "sans-serif-font-family");
     setting_add(c, "scripts", TYPE_BOOLEAN, &on, webkit, 0, "enable-javascript");
     setting_add(c, "serif-font", TYPE_CHAR, &"serif", webkit, 0, "serif-font-family");