Bug 1572404 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

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
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

Back to Bug 1572404 Comment 0