@whotracksme/reporting 11.0.0 β 11.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/package.json +1 -1
- package/reporting/src/http.js +0 -34
- package/reporting/src/network.js +50 -3
- package/reporting/test/helpers/in-memory-job-scheduler.js +1 -1
- package/reporting/test/network.spec.js +57 -1
- package/reporting/src/offscreen/doublefetch/offscreen-fix.js +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# v11.0.2 (Sat Jul 18 2026)
|
|
2
|
+
|
|
3
|
+
#### π Bug Fix
|
|
4
|
+
|
|
5
|
+
- Fix: undo offscreen window size attributes [#217](https://github.com/whotracksme/webextension-packages/pull/217) ([@chrmod](https://github.com/chrmod))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Krzysztof Modras ([@chrmod](https://github.com/chrmod))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v11.0.1 (Wed Jul 08 2026)
|
|
14
|
+
|
|
15
|
+
#### π Bug Fix
|
|
16
|
+
|
|
17
|
+
- Improve detection of non-sharable domains [#216](https://github.com/whotracksme/webextension-packages/pull/216) ([@philipp-classen](https://github.com/philipp-classen))
|
|
18
|
+
|
|
19
|
+
#### π Internal
|
|
20
|
+
|
|
21
|
+
- (tests only) Fix for rare "Exceeded maximum steps (steps=1000)" [#215](https://github.com/whotracksme/webextension-packages/pull/215) ([@philipp-classen](https://github.com/philipp-classen))
|
|
22
|
+
|
|
23
|
+
#### Authors: 1
|
|
24
|
+
|
|
25
|
+
- Philipp ClaΓen ([@philipp-classen](https://github.com/philipp-classen))
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
1
29
|
# v11.0.0 (Tue Jun 23 2026)
|
|
2
30
|
|
|
3
31
|
#### π₯ Breaking Change
|
package/package.json
CHANGED
package/reporting/src/http.js
CHANGED
|
@@ -316,37 +316,6 @@ async function tryCloseOffscreenDocument() {
|
|
|
316
316
|
|
|
317
317
|
const OFFSCREEN_DOCUMENT_PREFIX = 'offscreen/doublefetch';
|
|
318
318
|
const OFFSCREEN_DOCUMENT_INDEX_HTML = `${OFFSCREEN_DOCUMENT_PREFIX}/index.html`;
|
|
319
|
-
const OFFSCREEN_DOCUMENT_FIXES_JS = `${OFFSCREEN_DOCUMENT_PREFIX}/offscreen-fix.js`;
|
|
320
|
-
|
|
321
|
-
async function tryRegisterOffscreenFixes(domain) {
|
|
322
|
-
if (!chrome?.scripting?.registerContentScripts) {
|
|
323
|
-
logger.warn('Skipping offscreen-fixes (chrome.scripting API unavailable)');
|
|
324
|
-
return () => {};
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
logger.debug('Installing offscreen fixes for domain:', domain);
|
|
328
|
-
const id = 'offscreen-fix';
|
|
329
|
-
await chrome.scripting.registerContentScripts([
|
|
330
|
-
{
|
|
331
|
-
id,
|
|
332
|
-
matches: [`https://*.${domain}/*`, `https://${domain}/*`],
|
|
333
|
-
js: [OFFSCREEN_DOCUMENT_FIXES_JS],
|
|
334
|
-
runAt: 'document_start',
|
|
335
|
-
allFrames: true,
|
|
336
|
-
world: 'MAIN',
|
|
337
|
-
},
|
|
338
|
-
]);
|
|
339
|
-
|
|
340
|
-
return () => {
|
|
341
|
-
logger.debug('Removing offscreen fixes for domain:', domain);
|
|
342
|
-
chrome.scripting.unregisterContentScripts({ ids: [id] }).catch((e) => {
|
|
343
|
-
logger.error(
|
|
344
|
-
'cleanup failed: unable to remove offscreen fixes content script:',
|
|
345
|
-
e,
|
|
346
|
-
);
|
|
347
|
-
});
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
319
|
|
|
351
320
|
async function withOffscreenDocumentReady(url, headers, asyncCallback) {
|
|
352
321
|
const cleanups = [];
|
|
@@ -371,9 +340,6 @@ async function withOffscreenDocumentReady(url, headers, asyncCallback) {
|
|
|
371
340
|
const undoDNRChange = await addDNRSessionRule(rule);
|
|
372
341
|
cleanups.push(undoDNRChange);
|
|
373
342
|
|
|
374
|
-
const undoOffscreenFixes = await tryRegisterOffscreenFixes(domain);
|
|
375
|
-
cleanups.push(undoOffscreenFixes);
|
|
376
|
-
|
|
377
343
|
const undoHeaderOverride = await headerOverride({
|
|
378
344
|
headers,
|
|
379
345
|
url,
|
package/reporting/src/network.js
CHANGED
|
@@ -133,6 +133,44 @@ const WELL_KNOWN_HOSTNAME_IS_PRIVATE_NETWORK = {
|
|
|
133
133
|
'www.patreon.com': false,
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
+
// Domain suffixes that do not resolve in the public DNS, are
|
|
137
|
+
// reserved/used for private networks, or are infrastructure-only.
|
|
138
|
+
// Hostnames ending in one of these should be treated as internal
|
|
139
|
+
// and never shared publicly.
|
|
140
|
+
const NON_PUBLIC_DOMAIN_SUFFIXES = [
|
|
141
|
+
// RFC 6762 (Multicast DNS)
|
|
142
|
+
'.local',
|
|
143
|
+
|
|
144
|
+
// ICANN reserved for private use (2024)
|
|
145
|
+
'.internal',
|
|
146
|
+
|
|
147
|
+
// Not formally reserved, but common private-use TLDs
|
|
148
|
+
// (RFC 6762 Appendix G; .corp/.home/.mail frozen by ICANN)
|
|
149
|
+
'.intranet',
|
|
150
|
+
'.private',
|
|
151
|
+
'.corp',
|
|
152
|
+
'.home',
|
|
153
|
+
'.lan',
|
|
154
|
+
'.mail',
|
|
155
|
+
|
|
156
|
+
// RFC 6761 (Special-Use Domain Names)
|
|
157
|
+
'.localhost',
|
|
158
|
+
'.invalid',
|
|
159
|
+
'.test',
|
|
160
|
+
|
|
161
|
+
// RFC 3172 (infrastructure-only namespace, never user-facing content)
|
|
162
|
+
// Covers:
|
|
163
|
+
// - .home.arpa (RFC 8375 Homenet)
|
|
164
|
+
// - .in-addr.arpa / .ip6.arpa (reverse DNS for IPv4 / IPv6)
|
|
165
|
+
'.arpa',
|
|
166
|
+
|
|
167
|
+
// RFC 7686 (Tor)
|
|
168
|
+
'.onion',
|
|
169
|
+
|
|
170
|
+
// RFC 9476 (non-DNS naming systems)
|
|
171
|
+
'.alt',
|
|
172
|
+
];
|
|
173
|
+
|
|
136
174
|
// Simple function to detect IP addresses that are non-public.
|
|
137
175
|
// Local to the machine or link-only (belonging to a local network).
|
|
138
176
|
//
|
|
@@ -197,17 +235,26 @@ export class DnsResolver {
|
|
|
197
235
|
return isPrivate;
|
|
198
236
|
}
|
|
199
237
|
|
|
238
|
+
if (
|
|
239
|
+
NON_PUBLIC_DOMAIN_SUFFIXES.some((suffix) => hostname.endsWith(suffix))
|
|
240
|
+
) {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
|
|
200
244
|
// For the long tail, fall back to checking the IP address. Since we lack a
|
|
201
245
|
// DNS resolution API, we use mappings built from observing network requests.
|
|
202
|
-
|
|
246
|
+
const entry = this.dns.get(hostname);
|
|
247
|
+
if (entry) {
|
|
248
|
+
return isLocalIP(entry.ip);
|
|
249
|
+
}
|
|
250
|
+
|
|
203
251
|
// Note: Since this is a heuristic, there remains the question on how to deal
|
|
204
252
|
// with hostnames that we have not seen before. That case should be rare
|
|
205
253
|
// enough, since we work with hostnames that originate from visited websites.
|
|
206
254
|
// Yet if no such mapping exists, we have to guess. Assuming a hostname is
|
|
207
255
|
// private by default would be overly conservative; instead, we default to
|
|
208
256
|
// public unless proven otherwise.
|
|
209
|
-
|
|
210
|
-
return entry?.ip && isLocalIP(entry.ip);
|
|
257
|
+
return false;
|
|
211
258
|
}
|
|
212
259
|
|
|
213
260
|
cacheDnsResolution({ url, hostname, ip, now = Date.now() }) {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import { expect } from 'chai';
|
|
13
13
|
|
|
14
|
-
import { isLocalIP } from '../src/network.js';
|
|
14
|
+
import { isLocalIP, DnsResolver } from '../src/network.js';
|
|
15
15
|
|
|
16
16
|
describe('#isLocalIP', function () {
|
|
17
17
|
describe('it should recognize local IPv6 addresses', async function () {
|
|
@@ -70,3 +70,59 @@ describe('#isLocalIP', function () {
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
|
+
|
|
74
|
+
describe('DnsResolver', function () {
|
|
75
|
+
let uut;
|
|
76
|
+
|
|
77
|
+
beforeEach(function () {
|
|
78
|
+
uut = new DnsResolver();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('#isPrivateHostname', function () {
|
|
82
|
+
describe('must be always detected as private', function () {
|
|
83
|
+
for (const hostname of [
|
|
84
|
+
'127.0.0.1',
|
|
85
|
+
'localhost',
|
|
86
|
+
'homeassistant.local',
|
|
87
|
+
'raspberrypi.local',
|
|
88
|
+
'abc.internal',
|
|
89
|
+
'permanently-removed.invalid',
|
|
90
|
+
'www.nytimesn7cgmftshazwhfgzm37qxb44r64ytbb2dj3x62d2lljsciiyd.onion',
|
|
91
|
+
'foo.test',
|
|
92
|
+
'abc.def.corp',
|
|
93
|
+
'my.foo.lan',
|
|
94
|
+
]) {
|
|
95
|
+
it(`- ${hostname}`, function () {
|
|
96
|
+
expect(uut.isPrivateHostname(hostname)).to.be.true;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
describe('must be always detected as public', function () {
|
|
102
|
+
for (const hostname of [
|
|
103
|
+
'en.wikipedia.org',
|
|
104
|
+
'www.google.com',
|
|
105
|
+
'www.youtube.com',
|
|
106
|
+
]) {
|
|
107
|
+
it(`- ${hostname}`, function () {
|
|
108
|
+
expect(uut.isPrivateHostname(hostname)).to.be.false;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
describe('#isPrivateURL', function () {
|
|
115
|
+
it('should classify URLs with non-public suffixes as private', function () {
|
|
116
|
+
expect(uut.isPrivateURL('https://printer.local/status')).to.be.true;
|
|
117
|
+
expect(uut.isPrivateURL('http://db.internal:8080/')).to.be.true;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('should not classify ordinary public URLs as private', function () {
|
|
121
|
+
expect(uut.isPrivateURL('https://en.wikipedia.org/')).to.be.false;
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('should classify unparseable URLs as private', function () {
|
|
125
|
+
expect(uut.isPrivateURL('not-a-url')).to.be.true;
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
if (window.outerWidth === 0) {
|
|
2
|
-
Object.defineProperty(window, 'outerWidth', {
|
|
3
|
-
get: () => 1920,
|
|
4
|
-
configurable: true,
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (window.outerHeight === 0) {
|
|
9
|
-
Object.defineProperty(window, 'outerHeight', {
|
|
10
|
-
get: () => 1080,
|
|
11
|
-
configurable: true,
|
|
12
|
-
});
|
|
13
|
-
}
|