From e83b99b0e1c120ec480c6b0a4410bdf1aa7b89cc Mon Sep 17 00:00:00 2001 From: Kevin Velghe Date: Thu, 20 Oct 2016 17:44:10 +0200 Subject: [PATCH] Run javascript on document element This enables `:jseval` for users who disable javascript on webpages. --- qutebrowser/browser/webkit/webkittab.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index 507a9ba94..2a7fcc3b4 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) + result = self._widget.page().mainFrame().documentElement() \ + .evaluateJavaScript(code) if callback is not None: callback(result)