-
Notifications
You must be signed in to change notification settings - Fork 73
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.