From 43ff1b0d97d989aca1002db7667f7a1b84a686d9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 2 Aug 2016 14:17:39 +0200 Subject: [PATCH] Tunnel private-browsing to QtWebKit correctly --- qutebrowser/browser/webkit/webkitsettings.py | 3 +-- .../end2end/data/javascript/localstorage.html | 18 ++++++++++++++++++ tests/end2end/features/misc.feature | 7 +++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 tests/end2end/data/javascript/localstorage.html diff --git a/qutebrowser/browser/webkit/webkitsettings.py b/qutebrowser/browser/webkit/webkitsettings.py index b2012c162..7d29453cf 100644 --- a/qutebrowser/browser/webkit/webkitsettings.py +++ b/qutebrowser/browser/webkit/webkitsettings.py @@ -80,8 +80,7 @@ def update_settings(section, option): QWebSettings.setIconDatabasePath('') else: QWebSettings.setIconDatabasePath(cache_path) - else: - websettings.update_mappings(MAPPINGS, section, option) + websettings.update_mappings(MAPPINGS, section, option) def init(): diff --git a/tests/end2end/data/javascript/localstorage.html b/tests/end2end/data/javascript/localstorage.html new file mode 100644 index 000000000..9f8170610 --- /dev/null +++ b/tests/end2end/data/javascript/localstorage.html @@ -0,0 +1,18 @@ + + + + + + +

This page checks local storage on load and logs via console.log

+ + diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index fb0c22f1a..2f87721a6 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -471,6 +471,13 @@ Feature: Various utility commands. And I open cookies in a new tab Then the cookie qute-test should be set to 42 + ## https://github.com/The-Compiler/qutebrowser/issues/1742 + + Scenario: Private browsing is activated in QtWebKit without restart + When I set general -> private-browsing to true + And I open data/javascript/localstorage.html + Then "localstorage does not work!" should be logged via javascript + Scenario: :repeat-command Given I open data/scroll.html And I run :tab-only