catching greasemonkey errors aswell
This commit is contained in:
parent
583c7e4198
commit
8aa682e769
@ -2087,7 +2087,7 @@ class CommandDispatcher:
|
||||
widget = self._current_widget()
|
||||
try:
|
||||
widget.run_js_async(js_code, callback=jseval_cb, world=world)
|
||||
except OverflowError as e:
|
||||
except OverflowError:
|
||||
raise cmdexc.CommandError("World Id not in valid range")
|
||||
|
||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||
|
@ -948,6 +948,11 @@ class _WebEngineScripts(QObject):
|
||||
new_script = QWebEngineScript()
|
||||
try:
|
||||
world = int(script.jsworld)
|
||||
if not 0 <= world < 256:
|
||||
log.greasemonkey.error(
|
||||
"script {} has invalid value for '@qute-js-world'"
|
||||
": {}".format(script.name, script.jsworld))
|
||||
continue
|
||||
except ValueError:
|
||||
try:
|
||||
world = _JS_WORLD_MAP[usertypes.JsWorld[
|
||||
|
Loading…
Reference in New Issue
Block a user