-
Notifications
You must be signed in to change notification settings - Fork 56
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
Declaring compatible websites (without prompting the user) #700
Comments
I think most browsers are on a path to do what Safari does today with |
Chrome's first draft for MV3 intended to do that already1, but they changed their mind at some point. I'm not sure they want to revisit the default behavior just yet, probably not before MV4 anyway.
If adding more "host" arrays is undesirable, these two behaviors could still be locked in via options. I want to reiterate that the problem here is specifically the lack of consistency and choice in how these permissions are presented to the user. Perhaps:
When set to As for the second behavior, honestly I just wish Safari and Firefox stopped showing this button/toggle, because that's not what I mean when I specify If you want to keep them, then I'd love to see an option to hide it:
Footnotes
|
Note that this set up would allow something really cool: {
"name": "Dark mode on demand",
"manifest_version": 3,
"grant_host_permissions": false,
"propose_all_urls": false,
"content_scripts": [{
"matches": ["*://*/*"],
"css": ["darkmode.css"]
}]
} Specifically:
The best part is that every browser already has this logic and UI built in, it's just not exposed evenly. Footnotes |
Problem
The current optional host permission situation has a few inconsistencies and limitations across browsers. Here are some:
host_permissions
on installProposal: "suggested hosts" and "available hosts"
These issues could be resolved with two additional well-defined top-level keys for the manifest. These two keys could replace (or be preferred to)
host_permissions
,optional_host_permissions
andcontent_script.*.matches
suggested_hosts
permissions.request()
andpermissions.remove()
This is exactly how Safari currently treats
host_permissions
.available_hosts
Like
optional_host_permissions
, but:Example
This extension would show "No permissions requested" on install, then show a badge when the user visits YouTube. Optionally the user can enable the extension on any website that might be compatible.
Follow-up for Safari
Safari does not support
host_permissions
the way it was defined, so they should mark the key as "Not supported; aliased tosuggested_hosts
"Footnotes
Safari shows an "Always Allow on Every Website…" button (screenshot); Firefox has a toggle (screenshot) that is a footgun (support requests) ↩
Safari effectively allows this via plain
content_script.*.matches='*://*/*
, but the user is presented with "The extension wants to access this site" rather than "The extension is available for this site". My solution for this has been my webext-dynamic-content-script package. ↩The text was updated successfully, but these errors were encountered: