Skip to content

Commit 1b3aa6f

Browse files
committed
Add initial Request Blocklist feature configuration
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. 1 - https://privacy-test-pages.site/privacy-protections/request-blocklist/
1 parent 7c3af93 commit 1b3aa6f

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-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": "enabled",
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
{

schema/config.ts

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

2627
export { WebCompatSettings } from './features/webcompat';
2728
export { DuckPlayerSettings } from './features/duckplayer';
@@ -68,6 +69,7 @@ export type ConfigV5<VersionType> = {
6869
windowsWebviewFailures_DDGWV?: WindowsWebViewFailures<VersionType>;
6970
customUserAgent?: CustomUserAgentFeature<VersionType>;
7071
elementHiding?: ElementHidingFeature<VersionType>;
72+
requestBlocklist?: RequestBlocklistFeature<VersionType>;
7173
};
7274
unprotectedTemporary: SiteException[];
7375
};
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)