Skip to content

Commit bd8a91e

Browse files
committed
Add support to redirect to noop.json
There ar ea couple of AdGuard filters supporting this local resource. Reference: https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#noopjson
1 parent c1d8f59 commit bd8a91e

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/js/redirect-engine.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const extToMimeMap = new Map([
3838
[ 'gif', 'image/gif' ],
3939
[ 'html', 'text/html' ],
4040
[ 'js', 'text/javascript' ],
41+
[ 'json', 'application/json' ],
4142
[ 'mp3', 'audio/mp3' ],
4243
[ 'mp4', 'video/mp4' ],
4344
[ 'png', 'image/png' ],

src/js/redirect-resources.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ export default new Map([
162162
alias: [ 'noopjs', 'abp-resource:blank-js' ],
163163
data: 'text',
164164
} ],
165+
[ 'noop.json', {
166+
alias: [ 'noopjson' ],
167+
data: 'text',
168+
} ],
165169
[ 'noop.txt', {
166170
alias: 'nooptext',
167171
data: 'text',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)