Merge branch 'jseval-2' of https://github.com/paretje/qutebrowser into paretje-jseval-2
This commit is contained in:
commit
620b952bb2
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user