mozilla / multi-account-containers

Firefox Multi-Account Containers lets you keep parts of your online life separated into color-coded tabs that preserve your privacy. Cookies are separated by container, allowing you to use the web with multiple identities or accounts simultaneously.
https://addons.mozilla.org/firefox/addon/multi-account-containers/
Mozilla Public License 2.0
2.69k stars 335 forks source link

Duplicate "cookies" permissions in webextension/manifest.json #60

Closed pdehaan closed 7 years ago

pdehaan commented 7 years ago

Got a couple errors when trying to run the addons-linter against the web-extension, and looks like one we got some dupe permissions. Possibly nothing and Firefox ignores the dupe, but seemed to choke the linter which I guess is converting the duplicate string values to some object or something unwelcome.

Steps to reproduce:

  1. npm i addons-linter -D
  2. ./node_modules/.bin/addons-linter webextension --self-hosted

Actual results:

$ ./node_modules/.bin/addons-linter webextension --self-hosted
Validation Summary:

errors          1
notices         0
warnings        0

ERRORS:

Code                      Message                  Description                                                    File            Line   Column
MANIFEST_BAD_PERMISSION   The permission type is   Permissions must be strings. If a permission is an object,     manifest.json
                          unsupported.             it's likely from a Chrome App Extension and will not work in
                                                   Firefox. See https://mzl.la/1R1n1t0 (MDN Docs) for more
                                                   information.

Diff:

diff --git a/webextension/manifest.json b/webextension/manifest.json
index 150f073..54e137d 100644
--- a/webextension/manifest.json
+++ b/webextension/manifest.json
@@ -21,8 +21,7 @@

   "permissions": [
     "cookies",
-    "tabs",
-    "cookies"
+    "tabs"
   ],

   "browser_action": {

After:

$ ./node_modules/.bin/addons-linter webextension --self-hosted
Validation Summary:

errors          0
notices         0
warnings        0
pdehaan commented 7 years ago

TIL: Without that --self-hosted flag, you also get this error (which took a bit of debuggery):

ERRORS:

Code                      Message                        Description                                                    File            Line   Column
MANIFEST_UPDATE_URL       "update_url" is not allowed.   "applications.gecko.update_url" is not allowed for             manifest.json
                                                         Mozilla-hosted add-ons.