Run javascript on document element
This enables `:jseval` for users who disable javascript on webpages.
This commit is contained in:
parent
ebe656fdf9
commit
e83b99b0e1
@ -624,7 +624,8 @@ class WebKitTab(browsertab.AbstractTab):
|
|||||||
def run_js_async(self, code, callback=None, *, world=None):
|
def run_js_async(self, code, callback=None, *, world=None):
|
||||||
if world is not None and world != usertypes.JsWorld.jseval:
|
if world is not None and world != usertypes.JsWorld.jseval:
|
||||||
log.webview.warning("Ignoring world ID {}".format(world))
|
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:
|
if callback is not None:
|
||||||
callback(result)
|
callback(result)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user