Skip to content

Commit cd6e222

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 0efe1a6 commit cd6e222

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
@@ -21,6 +21,7 @@ import { CustomUserAgentFeature } from './features/custom-user-agent';
2121
import { BurnFeature } from './features/burn';
2222
import { Taskbar } from './features/taskbar';
2323
import { AppHealth } from './features/appHealth';
24+
import { RequestBlocklistFeature } from './features/request-blocklist';
2425

2526
export { WebCompatSettings } from './features/webcompat';
2627
export { DuckPlayerSettings } from './features/duckplayer';
@@ -65,6 +66,7 @@ export type ConfigV5<VersionType> = {
6566
scriptlets?: ScriptletsFeature<VersionType>;
6667
windowsWebviewFailures?: WindowsWebViewFailures<VersionType>;
6768
customUserAgent?: CustomUserAgentFeature<VersionType>;
69+
requestBlocklist?: RequestBlocklistFeature<VersionType>;
6870
};
6971
unprotectedTemporary: SiteException[];
7072
};
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)