Proposal: stop adding `host_permissions` from `content_scripts`
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 711
- Forks
- 95
- Avg merge
- 10d 11h
- Merged PRs (30d)
- 2
Description
Currently when using specific matches in content_scripts, they will be added to the list of host_permissions the extension requests / has access to (in some cases, only when granted).
My proposal is to stop this behavior and require devs to define this in either host_permissions, optional_permissions or permissions. This would align it with other APIs like the webRequest API. In addition to aligning it with other APIs, there are two more reasons for this change:
-
Some
host_permissionsyou only want to apply in specific cases. So the content_scripts will only be applied when thehost_permissionsare granted. This makes sure not allhost_permissionsare required to be granted right from the install of the extension. -
When having multiple
content_scriptsandmatches, you will end up polluting thehost_permissions. Say you have matches like these: "https://example.com/*something=true*", "https://example.com/*something=false*", "https://example.com/*test=true*". All of them will be added to thehost_permissionscausing conflicts with granting / removing permissions for specific domains. Easy solution here would just be to addhttps://example.com/*to the permissions.
Due to the backward compatibility issues, this may only be doable for manifest v4.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how content_scripts currently affect host_permissions, then compare the proposed explicit use of host_permissions, optional_permissions, or permissions. Consider the manifest v4 compatibility constraint and the backward-compatibility discussion. Done means the specification defines the changed permission behavior and its compatibility implications.
Written by the indexing model from the issue text.
Assessment
- Domain
- authorization, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100