Skip to content

Commit e46ecae

Browse files
committed
Add Request Blocklist test page
Add a simple test page for the Request Blocklist feature, that acts as a quick way for folks to test and see visually if the feature is enabled and working. Notes: - For detailed testing of the feature's edge-cases, see the reference tests[1]. - For automated integration tests, prefer the Request Blocking test page[2], which can be used with an empty blocklist and suitable configuration to check that requests are being blocked as expected. - See corresponding configuration changes[3]. 1 - https://github.com/duckduckgo/privacy-reference-tests/tree/main/request-blocklist 2 - https://privacy-test-pages.site/privacy-protections/request-blocking/ 3 - duckduckgo/privacy-configuration#3990
1 parent e2f0116 commit e46ecae

File tree

9 files changed

+160
-0
lines changed

9 files changed

+160
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ We have couple of test domains, that all resolve to `privacy-test-pages.site`, w
2727
- `good.third-party.site` - non-tracking third party, it's not on our blocklist and will not be blocked by our clients
2828
- `broken.third-party.site` - tracking third party that we can't block (e.g. due to brekage), it's on our blocklist, but it will not be blocked by our clients
2929
- `bad.third-party.site` - tracking third party that's on our blocklist and our clients will block
30+
- `allowlisted.third-party.site` - non-tracking third party, that is explicitly allowlisted by the Tracker Allowlist (to prevent the Request Blocklist from applying)
3031

3132
We also have additional domains specifically for the Ad Attribution tests hosted [here](https://www.search-company.site):
3233

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ <h2>Privacy Protections Tests</h2>
8484
<li><a href='./privacy-protections/query-parameters/'>Query Parameters</a></li>
8585
<li><a href='./privacy-protections/local-port-scan/'>Local port scanning</a></li>
8686
<li><a href='./privacy-protections/bounce-tracking/'>Bounce tracking</a></li>
87+
<li><a href='./privacy-protections/request-blocklist/'>Request Blocklist</a></li>
8788
</ul>
8889

8990
<h2 id="autofill">Autofill</h2>
2.71 KB
Loading
3.95 KB
Loading
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width">
6+
<title>Request Blocklist test page</title>
7+
8+
<style>
9+
#notes { margin-bottom: 20px; }
10+
#notes > * { margin: 0; font-style: italic; }
11+
table { border-collapse: collapse; }
12+
td { margin: 0; padding: 0px; width: 200px; height: 100px; border: 1px #000 solid; }
13+
img, iframe { display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; }
14+
.allow { background-color: red; background-image: url("./blocked-fail.png"); }
15+
.block { background-color: green; background-image: url("./blocked-pass.png");}
16+
</style>
17+
</head>
18+
<body>
19+
<p><a href="../index.html">[Home]</a></p>
20+
21+
<p>
22+
Simple test page that serves as a quick visual test to show if the Request
23+
Blocklist feature is active and working.
24+
</p>
25+
26+
<p>
27+
Test cases are shown as green if they are blocked/allowed as expected, and
28+
shown as red otherwise. Where possible, "Loaded"/"Blocked" text is also
29+
shown.
30+
</p>
31+
32+
<section id="notes">
33+
<p><b>Notes:</b></p>
34+
<ul>
35+
<li>
36+
Some browsers will display blocked frames as white/grey, instead of the
37+
green/red background that we want. Consider that a pass for the
38+
"Blocked ..." test cases, and a fail for the others.
39+
</li>
40+
<li>
41+
For automated integration tests, prefer the
42+
<a href="../request-blocking/">Request Blocking Test Page</a>. An empty
43+
blocklist + suitable Request Blocklist configuration can be used to test
44+
the feature.
45+
</li>
46+
</ul>
47+
</section>
48+
49+
<table>
50+
<thead>
51+
<tr>
52+
<th>Test result</th>
53+
<th>Description</th>
54+
</tr>
55+
</thead>
56+
<tbody>
57+
<tr>
58+
<td class="block">
59+
<img src="./loaded-fail.png?block=true"
60+
class="block">
61+
</td>
62+
<td>
63+
Blocked first-party image
64+
</td>
65+
</tr>
66+
<tr>
67+
<td class="block">
68+
<img src="https://third-party.site/privacy-protections/request-blocklist/loaded-fail.png?block=true"
69+
class="block">
70+
</td>
71+
<td>
72+
Blocked third-party image
73+
</td>
74+
</tr>
75+
<tr>
76+
<td class="block">
77+
<iframe src="./loaded-fail.html?block=true"
78+
class="block">
79+
</iframe>
80+
</td>
81+
<td>
82+
Blocked first-party frame
83+
</td>
84+
</tr>
85+
<tr>
86+
<td class="block">
87+
<iframe src="https://third-party.site/privacy-protections/request-blocklist/loaded-fail.html?block=true"
88+
class="block">
89+
</iframe>
90+
</td>
91+
<td>
92+
Blocked third-party frame
93+
</td>
94+
</tr>
95+
<tr>
96+
<td class="allow">
97+
<img src="./loaded-pass.png?block=false"
98+
class="allow">
99+
</td>
100+
<td>
101+
Unblocked first-party image
102+
</td>
103+
</tr>
104+
<tr>
105+
<td class="allow">
106+
<iframe src="./loaded-pass.html?block=false"
107+
class="allow">
108+
</iframe>
109+
</td>
110+
<td>
111+
Unblocked first-party frame
112+
</td>
113+
</tr>
114+
<tr>
115+
<td class="allow">
116+
<img src="https://allowlisted.third-party.site/privacy-protections/request-blocklist/loaded-pass.png?block=true"
117+
class="allow">
118+
</td>
119+
<td>
120+
Allowlisted third-party image
121+
</td>
122+
</tr>
123+
<tr>
124+
<td class="allow">
125+
<iframe src="https://allowlisted.third-party.site/privacy-protections/request-blocklist/loaded-pass.html?block=true"
126+
class="allow">
127+
</iframe>
128+
</td>
129+
<td>
130+
Allowlisted third-party frame
131+
</td>
132+
</tr>
133+
</tbody>
134+
</table>
135+
</body>
136+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
body { background-color: red; color: white; }
6+
h1 { font-size: 40px; font-family: sans-serif; font-weight: normal; text-align: center; }
7+
</style>
8+
<body>
9+
<h1>Loaded</h1>
10+
</body>
11+
</html>
2.24 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
body { background-color: green; color: white; }
6+
h1 { font-size: 40px; font-family: sans-serif; font-weight: normal; text-align: center; }
7+
</style>
8+
<body>
9+
<h1>Loaded</h1>
10+
</body>
11+
</html>
3.11 KB
Loading

0 commit comments

Comments
 (0)