diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 09dcca173..7ae6965c8 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -139,6 +139,7 @@ Changed - The `qute:settings` page now also shows option descriptions. - `qute:version` and `qutebrowser --version` now show various important paths - `:spawn`/userscripts now show a nicer error when a script wasn't found +- Various functionality now works when javascript is disabled with QtWebKit Deprecated ~~~~~~~~~~ diff --git a/README.asciidoc b/README.asciidoc index d1320ab83..0036e3c6f 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -158,8 +158,8 @@ Contributors, sorted by the number of commits in descending order: * Raphael Pierzina * Joel Torstensson * Patric Schmitz -* Tarcisio Fedrizzi * Kevin Velghe +* Tarcisio Fedrizzi * Claude * Corentin Julé * meles5 diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index 507a9ba94..6fefaa655 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -624,7 +624,8 @@ class WebKitTab(browsertab.AbstractTab): def run_js_async(self, code, callback=None, *, world=None): if world is not None and world != usertypes.JsWorld.jseval: log.webview.warning("Ignoring world ID {}".format(world)) - result = self._widget.page().mainFrame().evaluateJavaScript(code) + document_element = self._widget.page().mainFrame().documentElement() + result = document_element.evaluateJavaScript(code) if callback is not None: callback(result) diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index a86d88e20..dda097f00 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -71,3 +71,8 @@ Feature: Javascript stuff And I run :tab-only And I run :jseval if (window.open('about:blank')) { console.log('window opened'); } else { console.log('error while opening window'); } Then the javascript message "error while opening window" should be logged + + Scenario: Executing jseval when javascript is disabled + When I set content -> allow-javascript to false + And I run :jseval console.log('jseval executed') + Then the javascript message "jseval executed" should be logged