Skip to content

Commit fa0de99

Browse files
authored
Add initial Request Blocklist feature configuration (#3990)
Add an initial configuration for the new Request Blocklist feature. Include a couple of testing rules, for the privacy test page[1]. Also include a corresponding Tracker Allowlist rule for the test page as well. The feature is only implemented for the extension so far, so let's enable it there but leave it disabled for other platforms. 1 - https://privacy-test-pages.site/privacy-protections/request-blocklist/
1 parent 1ba758b commit fa0de99

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed

features/request-blocklist.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"_meta": {
3+
"description": "Request blocking rules necessary to fix website breakage. Note: Tracker request blocking is handled elsewhere.",
4+
"sampleExcludeRecords": {
5+
"domain": "example.com",
6+
"reason": "site breakage"
7+
}
8+
},
9+
"state": "disabled",
10+
"settings": {
11+
"blockedRequests": {
12+
"privacy-test-pages.site": {
13+
"rules": [
14+
{
15+
"rule": "privacy-test-pages.site/privacy-protections/request-blocklist/*?block=true",
16+
"domains": [
17+
"privacy-test-pages.site"
18+
],
19+
"reason": "Testing rule for the privacy test page, see https://privacy-test-pages.site/privacy-protections/request-blocklist/"
20+
}
21+
]
22+
},
23+
"third-party.site": {
24+
"rules": [
25+
{
26+
"rule": "third-party.site/privacy-protections/request-blocklist/*?block=true",
27+
"domains": [
28+
"privacy-test-pages.site"
29+
],
30+
"reason": "Testing rule for the privacy test page, see https://privacy-test-pages.site/privacy-protections/request-blocklist/"
31+
}
32+
]
33+
}
34+
}
35+
},
36+
"exceptions": []
37+
}

features/tracker-allowlist.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@
99
"state": "enabled",
1010
"settings": {
1111
"allowlistedTrackers": {
12+
"third-party.site": {
13+
"rules": [
14+
{
15+
"rule": "allowlisted.third-party.site",
16+
"domains": [
17+
"privacy-test-pages.site"
18+
],
19+
"reason": "Testing rule for the privacy test pages"
20+
}
21+
]
22+
},
1223
"2mdn.net": {
1324
"rules": [
1425
{

overrides/extension-override.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@
208208
]
209209
}
210210
}
211+
},
212+
"requestBlocklist": {
213+
"state": "enabled"
211214
}
212215
},
213216
"unprotectedTemporary": [

schema/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { BurnFeature } from './features/burn';
2323
import { Taskbar } from './features/taskbar';
2424
import { AppHealth } from './features/appHealth';
2525
import { ElementHidingFeature } from './features/element-hiding';
26+
import { RequestBlocklistFeature } from './features/request-blocklist';
2627

2728
export { WebCompatSettings } from './features/webcompat';
2829
export { DuckPlayerSettings } from './features/duckplayer';
@@ -70,6 +71,7 @@ export type ConfigV5<VersionType> = {
7071
windowsWebviewFailures_DDGWV?: WindowsWebViewFailures<VersionType>;
7172
customUserAgent?: CustomUserAgentFeature<VersionType>;
7273
elementHiding?: ElementHidingFeature<VersionType>;
74+
requestBlocklist?: RequestBlocklistFeature<VersionType>;
7375
};
7476
unprotectedTemporary: SiteException[];
7577
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Feature } from '../feature';
2+
3+
type RuleType = {
4+
rule: string;
5+
domains: string[];
6+
reason: string[] | string;
7+
};
8+
9+
type SettingsType = {
10+
blockedRequests: {
11+
[domain: string]: {
12+
rules: RuleType[];
13+
};
14+
};
15+
};
16+
17+
export type RequestBlocklistFeature<VersionType> = Feature<SettingsType, VersionType>;

0 commit comments

Comments
 (0)