Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lnoss opened this issue Dec 20, 2023 · 2 comments
Assignees
Labels
bug Something isn't working firefox Something-something specific about Firefox

Comments

@lnoss
Copy link
Owner

lnoss commented Dec 20, 2023

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.

@lnoss lnoss added the bug Something isn't working label Dec 20, 2023
@lnoss lnoss self-assigned this Dec 20, 2023
@lnoss lnoss added the firefox Something-something specific about Firefox label Dec 20, 2023
@lnoss lnoss changed the title Firefox MV3 extension host_permissions are considered as optional permissions and are not request by default on installation Firefox MV3 extension host_permissions are considered as optional permissions and are not requested for approval automatically on installation Dec 20, 2023
@lnoss lnoss changed the title Firefox MV3 extension host_permissions are considered as optional permissions and are not requested for approval automatically on installation Firefox MV3 extension host_permissions are considered as optional permissions and are not automatically requested for approval on installation Dec 20, 2023
@lnoss
Copy link
Owner Author

lnoss commented Dec 20, 2023

Also, runtime.onInstalled. Extension could open a tab with a grant permissions button with a callback to permissions.request(). No wonder people are tearing themselves apart between the two Manifest versions.

@lnoss
Copy link
Owner Author

lnoss commented Dec 20, 2023

Also, see Bugzilla 1839129.

Starting with Firefox 109 all host_permissions are considered optional so it appears what you are considering is an enhancement more than a bug.

🤐

lnoss added a commit that referenced this issue Dec 20, 2023
Workflows seem not stable, and I don't want to work on a extension interface to handle permissions. It should be more properly handled by the web browser.

Refs: #5, 748c278
@lnoss lnoss pinned this issue Dec 20, 2023
@lnoss lnoss unpinned this issue Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working firefox Something-something specific about Firefox
Projects
None yet
Development

No branches or pull requests

1 participant