[mozprofile] install addon with browser_specific_settings
Categories
(Testing :: Mozbase, defect)
Tracking
(firefox70 fixed)
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: tarek, Assigned: tarek)
References
Details
Attachments
(1 file)
webextensions now uses browser_specific_settings instead of application in the manifest file. mozprofile can't detect in that case the gecko id and ends up generating a new uuid for the addon, making it temporary.
The fix seems trivial in AddonManager.addon_details :
$ hg di testing/mozbase/mozprofile/mozprofile/addons.py
diff --git a/testing/mozbase/mozprofile/mozprofile/addons.py b/testing/mozbase/mozprofile/mozprofile/addons.py
--- a/testing/mozbase/mozprofile/mozprofile/addons.py
+++ b/testing/mozbase/mozprofile/mozprofile/addons.py
@@ -282,17 +282,20 @@ class AddonManager(object):
reraise(AddonFormatError, AddonFormatError(str(e)), sys.exc_info()[2])
if is_webext:
details['version'] = manifest['version']
details['name'] = manifest['name']
try:
details['id'] = manifest['applications']['gecko']['id']
except KeyError:
- details['id'] = cls._gen_iid(addon_path)
+ try:
+ details['id'] = manifest['browser_specific_settings']['gecko']['id']
+ except KeyError:
+ details['id'] = cls._gen_iid(addon_path)
details['unpack'] = False
else:
try:
doc = minidom.parseString(manifest)
# Get the namespaces abbreviations
em = get_namespace_id(doc, 'http://www.mozilla.org/2004/em-rdf#')
rdf = get_namespace_id(doc, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')
If that change sounds good I'll push a patch along with a test
Note that the code above for accessing manifest['applications']['gecko']['id']
is in a block which only gets executed for web extensions. I wonder when the change from application
to browser_specific_settings
happened, and if we would still have to support the former location. Personally I doubt so, and it might be good to simply change the already existing line.
Andrew, could you give more details for the above? Thanks.
Assignee | ||
Comment 2•5 years ago
•
|
||
Comment 3•5 years ago
|
||
browser_specific_settings
was the name proposed for the cross-browser browser extensions spec:
https://browserext.github.io/browserext/#list-of-keys
Firefox implements that manifest key (but it will accept either applications
or browser_specific_settings
for compatibility) but the w3c spec never really went anywhere.
So I would suggest that we also should support both locations of the extension id. Tarek feel free to add that, and an unit test too.
Assignee | ||
Comment 5•5 years ago
|
||
yeah ok. for the record it's the key used by uBlock - which is currently not installable as a non-temporary webextension via mozprofile
Assignee | ||
Comment 6•5 years ago
|
||
webextensions now uses "browser_specific_settings" instead of "applications" in
the manifest file. This patch make mozprofile look for both places.
Assignee | ||
Comment 7•5 years ago
|
||
Comment 9•5 years ago
|
||
bugherder |
Description
•