Run javascript on document element

This enables `:jseval` for users who disable javascript on webpages.
This commit is contained in:
Kevin Velghe 2016-10-20 17:44:10 +02:00
parent ebe656fdf9
commit e83b99b0e1

View File

@ -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)