Request permissions rather than requiring them
Is there a way to make a request for extra permissions rather than requiring them? I want to add functionality, but since my extension is more privacy oriented, there's concern when I added extra permission. https://addons.mozilla.org/en-US/firefox/addon/volume-control-boost-volume/
所有回覆 (12)
Best it to take this to the Mozilla Discourse forum site.
Can you give an example of what kind of permission you want to add? You can use the "optional_permissions" key in your manifest. As an example:
- manifest v2: https://github.com/jscher2000/Show-History-Frequent-Sites-button-extension/blob/master/manifest.json#L35
- manifest v3: https://github.com/jscher2000/firefox-window-autonumber/blob/main/manifest.json#L25
Ref. https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions
jscher2000 - Support Volunteer said
Can you give an example of what kind of permission you want to add? You can use the "optional_permissions" key in your manifest. As an example:Ref. https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions
- manifest v2: https://github.com/jscher2000/Show-History-Frequent-Sites-button-extension/blob/master/manifest.json#L35
- manifest v3: https://github.com/jscher2000/firefox-window-autonumber/blob/main/manifest.json#L25
Thanks your response is most helpful. The new permission required is “all site data”, so my extension can view iframes allowing it to work on way more sites
jscher2000 - Support Volunteer said
Can you give an example of what kind of permission you want to add? You can use the "optional_permissions" key in your manifest. As an example:Ref. https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions
- manifest v2: https://github.com/jscher2000/Show-History-Frequent-Sites-button-extension/blob/master/manifest.json#L35
- manifest v3: https://github.com/jscher2000/firefox-window-autonumber/blob/main/manifest.json#L25
If you have the time to amend it that would be a very nice contribution https://github.com/Chaython/volumecontrol
Chaython said
The new permission required is “all site data”, so my extension can view iframes allowing it to work on way more sites
I think you can write that as
"optional_permissions": ["<all_urls>"]
but I don't think I've ever tested that.
jscher2000 - Support Volunteer said
Chaython said
The new permission required is “all site data”, so my extension can view iframes allowing it to work on way more sitesI think you can write that as
"optional_permissions": ["<all_urls>"]
but I don't think I've ever tested that.
The suggestion did add it to the optional permissions, but it's still putting it as a required permission regardless.
Chaython said
jscher2000 - Support Volunteer said
Chaython said
The new permission required is “all site data”, so my extension can view iframes allowing it to work on way more sitesI think you can write that as
"optional_permissions": ["<all_urls>"]
but I don't think I've ever tested that.
The suggestion did add it to the optional permissions, but it's still putting it as a required permission regardless.
Do you still have a copy of the signed XPI that causes this?
I don't have a signed XPI, I deleted the package after I got emails complaining of the new permission requirement. With the optional permission set, I only ran it in about:Debugging it showed the permission as required and also as optional... However for some reason despite not requesting the permission, it's used in the permission list. The issue doesn't persist in Manifest V3, but I haven't published it yet. Because it warns Manifest v3 isn't supported by many firefox revisions.
Actually in about:Debugging the extension, shows all urls as optional, but after uploading the extension it shows all site data required on the extension page.
https://addons.mozilla.org/en-US/firefox/addon/volume-control-boost-volume/jscher2000 - Support Volunteer said
Chaython said
jscher2000 - Support Volunteer said
Chaython said
The new permission required is “all site data”, so my extension can view iframes allowing it to work on way more sitesI think you can write that as
"optional_permissions": ["<all_urls>"]
but I don't think I've ever tested that.
The suggestion did add it to the optional permissions, but it's still putting it as a required permission regardless.
Do you still have a copy of the signed XPI that causes this?
Firefox understands that it's an optional permission: I'm not prompted to approve that permission when I install the add-on, and it shows as optional on the Add-ons page, Permissions panel.
So it looks like a bug in the Add-ons site. I didn't see anything similar mentioned here: https://github.com/mozilla/addons/issues
Before filing a new bug report, could you try something: split your two permissions like this to see whether it makes any difference:
"permissions": ["activeTab"], "optional_permissions": ["<all_urls>"],
Or maybe you already tested that.
jscher2000 - Support Volunteer said
Firefox understands that it's an optional permission: I'm not prompted to approve that permission when I install the add-on, and it shows as optional on the Add-ons page, Permissions panel. So it looks like a bug in the Add-ons site. I didn't see anything similar mentioned here: https://github.com/mozilla/addons/issues Before filing a new bug report, could you try something: split your two permissions like this to see whether it makes any difference: "permissions": ["activeTab"], "optional_permissions": ["<all_urls>"], Or maybe you already tested that.
I didnt work with manifest v2 so I didnt bother in v3, the all_urls seems to be a parent permission of activetab / activetab is present for all extensions (no notification of its presence is active in the extension)
My other thought was that the matches list of the content_scripts key is equivalent to "<all_urls>" but I don't know whether that should be considered in Manifest V3.