-
Notifications
You must be signed in to change notification settings - Fork 82
Proposal: stop adding host_permissions from content_scripts #116
Copy link
Copy link
Open
Labels
enhancementEnhancement or change to an existing featureEnhancement or change to an existing featureneeds-triage: chromeChrome needs to assess this issue for the first timeChrome needs to assess this issue for the first timeneeds-triage: firefoxFirefox needs to assess this issue for the first timeFirefox needs to assess this issue for the first timeproposalProposal for a change or new featureProposal for a change or new featuresupportive: safariSupportive from SafariSupportive from Safari
Metadata
Metadata
Assignees
Labels
enhancementEnhancement or change to an existing featureEnhancement or change to an existing featureneeds-triage: chromeChrome needs to assess this issue for the first timeChrome needs to assess this issue for the first timeneeds-triage: firefoxFirefox needs to assess this issue for the first timeFirefox needs to assess this issue for the first timeproposalProposal for a change or new featureProposal for a change or new featuresupportive: safariSupportive from SafariSupportive from Safari
Currently when using specific matches in
content_scripts, they will be added to the list ofhost_permissionsthe 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_permissionsorpermissions. 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.