Skip to content

Commit

Permalink
Use ephemeral webview if incognito option is used #562
Browse files Browse the repository at this point in the history
Also removed obsolete 'private-browsing' setting.
  • Loading branch information
fanglingsu committed Jun 14, 2019
1 parent 59ff7b7 commit c9a7950
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions doc/vimb.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion src/setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit c9a7950

Please sign in to comment.