Add declarativeNetRequest (DNR) + MV3 examples (#526)

These examples are designed to be cross-browser compatible.
In particular, these extensions do not use `background` because there is
currently no single manifest that can support both Firefox and Chrome,
due to the lack of event page support in Chrome, and the lack of service
worker support in Firefox.

Three examples demonstrating the use of the declarativeNetRequest API:
- dnr-block-only: One minimal example demonstrating the use of static
  DNR rules to block requests.
- dnr-redirect-url: One minimal example demonstrating the use of static
  DNR rules to redirect requests.
- dnr-dynamic-with-options: A generic example demonstrating how host
  permissions can be requested and free forms to input DNR rules.
This commit is contained in:
Rob Wu
2023-05-17 18:13:55 +02:00
committed by GitHub
parent 9433f842d6
commit 06330a69c2
17 changed files with 735 additions and 1 deletions

View File

@@ -8,12 +8,15 @@
"es6": true,
"webextensions": true
},
"globals": {
"globalThis": false
},
"extends": [
"eslint:recommended"
],
"rules": {
"no-console": 0,
"no-unused-vars": ["warn", { "vars": "all", "args": "all" } ],
"no-unused-vars": ["warn", { "vars": "all", "args": "after-used" } ],
"no-undef": ["warn"],
"no-proto": ["error"],
"prefer-arrow-callback": ["warn"],