-
Notifications
You must be signed in to change notification settings - Fork 2
Description
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:
- Clicking the extension's browser action or page action.
- Selecting a context menu item defined by the extension.
- Activating a keyboard shortcut defined by the extension (this only treated as a user action from Firefox 63 onwards).
- Clicking a button in a page bundled with the extension
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/User_actions
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
Documentation
Error: permissions.request may only be called from a user input handler.


