referer-mod icon indicating copy to clipboard operation
referer-mod copied to clipboard

Request host permissions if necessary

Open airtower-luna opened this issue 3 years ago • 1 comments

With Manifest v3 host permissions (used to modify requests and inject scripts) have to be requested via host_permissions (see migration guide). Host permission are optional as a matter of principle, and as I found in tests not granted on install by default (or at least not the way Selenium does the installation).

Extensions can check if they have certain permissions and request them using the permissions API.

If it stays that way for the Manifest v3 release, the following seems like a reasonable approach:

  • Install the extension with modifications disabled.
  • If the user enables the extension, request host permissions.

airtower-luna avatar Nov 06 '22 11:11 airtower-luna

declarativeNetRequest works without host permission, but is very limited: For modifying headers, the header can only be removed, or set/appended to with a fixed string. This would break "prune" and "target" rules.

airtower-luna avatar May 22 '23 21:05 airtower-luna