catching greasemonkey errors aswell
This commit is contained in:
parent
583c7e4198
commit
8aa682e769
@ -2087,7 +2087,7 @@ class CommandDispatcher:
|
|||||||
widget = self._current_widget()
|
widget = self._current_widget()
|
||||||
try:
|
try:
|
||||||
widget.run_js_async(js_code, callback=jseval_cb, world=world)
|
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")
|
raise cmdexc.CommandError("World Id not in valid range")
|
||||||
|
|
||||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||||
|
@ -948,6 +948,11 @@ class _WebEngineScripts(QObject):
|
|||||||
new_script = QWebEngineScript()
|
new_script = QWebEngineScript()
|
||||||
try:
|
try:
|
||||||
world = int(script.jsworld)
|
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:
|
except ValueError:
|
||||||
try:
|
try:
|
||||||
world = _JS_WORLD_MAP[usertypes.JsWorld[
|
world = _JS_WORLD_MAP[usertypes.JsWorld[
|
||||||
|
Loading…
Reference in New Issue
Block a user