Skip to content

Commit

Permalink
Add support to redirect to noop.json
Browse files Browse the repository at this point in the history
There ar ea couple of AdGuard filters supporting this local
resource.

Reference:
https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#noopjson
  • Loading branch information
gorhill committed Nov 16, 2023
1 parent c1d8f59 commit bd8a91e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/js/redirect-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const extToMimeMap = new Map([
[ 'gif', 'image/gif' ],
[ 'html', 'text/html' ],
[ 'js', 'text/javascript' ],
[ 'json', 'application/json' ],
[ 'mp3', 'audio/mp3' ],
[ 'mp4', 'video/mp4' ],
[ 'png', 'image/png' ],
Expand Down
4 changes: 4 additions & 0 deletions src/js/redirect-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ export default new Map([
alias: [ 'noopjs', 'abp-resource:blank-js' ],
data: 'text',
} ],
[ 'noop.json', {
alias: [ 'noopjson' ],
data: 'text',
} ],
[ 'noop.txt', {
alias: 'nooptext',
data: 'text',
Expand Down
1 change: 1 addition & 0 deletions src/web_accessible_resources/noop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}

0 comments on commit bd8a91e

Please sign in to comment.