Make sure scripts are removed correctly
This commit is contained in:
parent
a37ecc353c
commit
6aafe02320
@ -262,9 +262,10 @@ def inject_userscripts():
|
||||
scripts = profile.scripts()
|
||||
for script in scripts.toList():
|
||||
if script.name().startswith("GM-"):
|
||||
log.greasemonkey.debug('removing script: {}'
|
||||
log.greasemonkey.debug('Removing script: {}'
|
||||
.format(script.name()))
|
||||
scripts.remove(script)
|
||||
removed = scripts.remove(script)
|
||||
assert removed, script.name()
|
||||
|
||||
# Then add the new scripts.
|
||||
for script in greasemonkey.all_scripts():
|
||||
|
@ -319,9 +319,10 @@ class WebEnginePage(QWebEnginePage):
|
||||
scripts = self.scripts()
|
||||
for script in scripts.toList():
|
||||
if script.name().startswith("GM-"):
|
||||
really_removed = scripts.remove(script)
|
||||
log.greasemonkey.debug("Removing ({}) script: {}"
|
||||
.format(really_removed, script.name()))
|
||||
log.greasemonkey.debug("Removing script: {}"
|
||||
.format(script.name()))
|
||||
removed = scripts.remove(script)
|
||||
assert removed, script.name()
|
||||
|
||||
def _add_script(script, injection_point):
|
||||
new_script = QWebEngineScript()
|
||||
|
Loading…
Reference in New Issue
Block a user