Skip to content

Proposal: stop adding host_permissions from content_scripts #116

@carlosjeurissen

Description

@carlosjeurissen

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:

  1. Some host_permissions you only want to apply in specific cases. So the content_scripts will only be applied when the host_permissions are granted. This makes sure not all host_permissions are required to be granted right from the install of the extension.

  2. When having multiple content_scripts and matches, you will end up polluting the host_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 the host_permissions causing conflicts with granting / removing permissions for specific domains. Easy solution here would just be to add https://example.com/* to the permissions.

Due to the backward compatibility issues, this may only be doable for manifest v4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement or change to an existing featureneeds-triage: chromeChrome needs to assess this issue for the first timeneeds-triage: firefoxFirefox needs to assess this issue for the first timeproposalProposal for a change or new featuresupportive: safariSupportive from Safari

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions