From 2097876b4633ea22e55b0c04c77264db95531626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Ziad=C3=A9?= Date: Tue, 20 Aug 2019 09:16:54 +0000 Subject: [PATCH] Bug 1572404 - [mozprofile] install addon with browser_specific_settings r=whimboo webextensions now uses "browser_specific_settings" instead of "applications" in the manifest file. This patch make mozprofile look for both places. Differential Revision: https://phabricator.services.mozilla.com/D42457 --HG-- extra : moz-landing-system : lando --- testing/mozbase/mozprofile/mozprofile/addons.py | 12 +++++++++--- ...pply-css-id-via-browser-specific-settings.xpi | Bin 0 -> 6444 bytes testing/mozbase/mozprofile/tests/test_addons.py | 13 +++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 testing/mozbase/mozprofile/tests/addons/apply-css-id-via-browser-specific-settings.xpi diff --git a/testing/mozbase/mozprofile/mozprofile/addons.py b/testing/mozbase/mozprofile/mozprofile/addons.py index 6c3ccc534935..c08cebd5d5cd 100644 --- a/testing/mozbase/mozprofile/mozprofile/addons.py +++ b/testing/mozbase/mozprofile/mozprofile/addons.py @@ -284,9 +284,15 @@ class AddonManager(object): if is_webext: details['version'] = manifest['version'] details['name'] = manifest['name'] - try: - details['id'] = manifest['applications']['gecko']['id'] - except KeyError: + # Bug 1572404 - we support two locations for gecko-specific + # metadata. + for location in ('applications', 'browser_specific_settings'): + try: + details['id'] = manifest[location]['gecko']['id'] + break + except KeyError: + pass + if details['id'] is None: details['id'] = cls._gen_iid(addon_path) details['unpack'] = False else: diff --git a/testing/mozbase/mozprofile/tests/addons/apply-css-id-via-browser-specific-settings.xpi b/testing/mozbase/mozprofile/tests/addons/apply-css-id-via-browser-specific-settings.xpi new file mode 100644 index 0000000000000000000000000000000000000000..c9ad38f63b10ff54db08413482c2f1a4825e2e2b GIT binary patch literal 6444 zcma)A1yCI6)*T=?1ZR*0A4qWb0Kp0F1b24^3ldxgcL@@l;1Gg4!GpUj?jGEElk9uh zt=)a^|7)tJdaC9-eY?+h?zw#wq~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