Fix passing filename to GreasemonkeyScript

This commit is contained in:
Florian Bruhin 2018-10-05 19:25:19 +02:00
parent 25e396faea
commit bb35285914

View File

@ -248,7 +248,8 @@ class GreasemonkeyManager(QObject):
continue
script_path = os.path.join(scripts_dir, script_filename)
with open(script_path, encoding='utf-8-sig') as script_file:
script = GreasemonkeyScript.parse(script_file.read())
script = GreasemonkeyScript.parse(script_file.read(),
script_filename)
if not script.name:
script.name = script_filename
self.add_script(script, force)