Skip to content

Firefox MV3 extension host_permissions are considered as optional permissions and are not automatically requested for approval on installation #5

@lnoss

Description

@lnoss

Context

I migrated as soon as possible the Firefox extension to MV3 for long-term purpose. But it seems that there is a non-standard behavior: Firefox uses host_permissions from package.json as optional. This is not the case with the Chromium world: optional permissions are optional. Chromium will automatically ask to approve or deny host_permissions on installation.

Also, you can't request a permission as you want:

To follow the principle of "no surprises", [some] APIs like this can only be called from inside the handler for a user action. User actions include the following:

This behavior is clearly annoying because I already pushed 0.0.3 to Mozilla Addons store. I deactivated the release even if it was working if approving manually the permissions ; the store only gives the possibility to install 0.0.1 (firefox-mv2).

Solution

I am thinking about just asking to press a button to approve everything... But this is not optimal and I have no idea about how handle the removal of permissions at any time, I might need to monitor permissions change. Or just let the techy-users use the browser interface. Otherwise, it means implementing an options page with check-boxes because no one is going to open the settings and approve it manually. The actual green icon requesting for approval is not even visible/understandable.

User solution

Go in your extensions menu and right-click on the extension (or the gear) when using currently using Google Search/Google Translate proxy. Approve the right permission auto requested. You can approve more directly by managing the extension settings. Check official illustrations below.

Official illustrations

2023-01-26-04-25-48-6f6e3c
2023-05-09-07-26-52-c5668e
2020-11-20-09-47-28-588de3

Documentation

Error: permissions.request may only be called from a user input handler.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requestfirefoxSomething-something specific about Firefox

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions