summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2016-08-02 14:17:39 +0200
committerFlorian Bruhin <git@the-compiler.org>2016-08-02 14:24:34 +0200
commitf73f3a2001c20f55640a67b1c31ed16a19d8a326 (patch)
tree0a67d5f90cc1e076946df80dc54393cfb2c79006
parentafde5bbc79d3186bd32dd0be0293445a3bf10557 (diff)
downloadqutebrowser-f73f3a2001c20f55640a67b1c31ed16a19d8a326.tar.gz
qutebrowser-f73f3a2001c20f55640a67b1c31ed16a19d8a326.zip
Tunnel private-browsing to QtWebKit correctly
-rw-r--r--qutebrowser/config/websettings.py14
-rw-r--r--tests/end2end/data/javascript/localstorage.html18
-rw-r--r--tests/end2end/features/misc.feature7
3 files changed, 32 insertions, 7 deletions
diff --git a/qutebrowser/config/websettings.py b/qutebrowser/config/websettings.py
index 2bc085e1b..f7a063017 100644
--- a/qutebrowser/config/websettings.py
+++ b/qutebrowser/config/websettings.py
@@ -433,10 +433,10 @@ def update_settings(section, option):
QWebSettings.setIconDatabasePath('')
else:
QWebSettings.setIconDatabasePath(cache_path)
- else:
- try:
- mapping = MAPPINGS[section][option]
- except KeyError:
- return
- value = config.get(section, option)
- mapping.set(value)
+
+ try:
+ mapping = MAPPINGS[section][option]
+ except KeyError:
+ return
+ value = config.get(section, option)
+ mapping.set(value)
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 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script type="text/javascript">
+ function check_storage() {
+ try {
+ localStorage.qute_test = "foo";
+ console.log("localstorage works!");
+ } catch (e) {
+ console.log("localstorage does not work!");
+ }
+ }
+ </script>
+ </head>
+ <body onload="check_storage()">
+ <p>This page checks local storage on load and logs via console.log</p>
+ </body>
+</html>
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