@whotracksme/reporting 5.1.32 → 5.1.34
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 +24 -0
- package/package.json +1 -1
- package/reporting/example/manifests/chromium.json +0 -1
- package/reporting/src/request/index.js +41 -34
- package/reporting/src/request/steps/token-telemetry/cached-entry-pipeline.js +1 -1
- package/reporting/test/request/index.spec.js +1 -0
- package/reporting/test/request/index.test.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# v5.1.34 (Thu Nov 14 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Request: fix token telemetry cleanup [#130](https://github.com/whotracksme/webextension-packages/pull/130) ([@chrmod](https://github.com/chrmod))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Krzysztof Modras ([@chrmod](https://github.com/chrmod))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v5.1.33 (Tue Nov 12 2024)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- Request: ensure webRequest listeners are ready [#129](https://github.com/whotracksme/webextension-packages/pull/129) ([@chrmod](https://github.com/chrmod))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- Krzysztof Modras ([@chrmod](https://github.com/chrmod))
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
1
25
|
# v5.1.32 (Tue Nov 12 2024)
|
|
2
26
|
|
|
3
27
|
#### 🐛 Bug Fix
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ import * as datetime from './utils/time.js';
|
|
|
23
23
|
import QSWhitelist2 from './qs-whitelist2.js';
|
|
24
24
|
import TempSet from './utils/temp-set.js';
|
|
25
25
|
import { HashProb, shouldCheckToken } from './hash/index.js';
|
|
26
|
-
import {
|
|
26
|
+
import { COOKIE_MODE, VERSION } from './config.js';
|
|
27
27
|
import { shuffle } from './utils/utils.js';
|
|
28
28
|
import random from '../random.js';
|
|
29
29
|
|
|
@@ -35,8 +35,8 @@ import TokenExaminer from './steps/token-examiner.js';
|
|
|
35
35
|
import TokenTelemetry from './steps/token-telemetry/index.js';
|
|
36
36
|
import OAuthDetector from './steps/oauth-detector.js';
|
|
37
37
|
import {
|
|
38
|
-
checkValidContext,
|
|
39
38
|
checkSameGeneralDomain,
|
|
39
|
+
checkValidContext,
|
|
40
40
|
} from './steps/check-context.js';
|
|
41
41
|
import PageStore from './page-store.js';
|
|
42
42
|
|
|
@@ -73,8 +73,38 @@ export default class RequestReporter {
|
|
|
73
73
|
notifyPageStageListeners: this.onPageStaged.bind(this),
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
this.ready = false;
|
|
77
|
+
const urls = ['http://*/*', 'https://*/*'];
|
|
78
|
+
// TODO: find a way to detect if blocking webRequest is available on Brave and Opera
|
|
79
|
+
const blockingWebRequest = chrome.runtime
|
|
80
|
+
.getManifest()
|
|
81
|
+
.permissions.includes('webRequestBlocking');
|
|
82
|
+
|
|
83
|
+
chrome.webRequest.onBeforeRequest.addListener(
|
|
84
|
+
this.onBeforeRequest,
|
|
85
|
+
{ urls },
|
|
86
|
+
blockingWebRequest
|
|
87
|
+
? Object.values(chrome.webRequest.OnBeforeRequestOptions)
|
|
88
|
+
: undefined,
|
|
89
|
+
);
|
|
90
|
+
chrome.webRequest.onBeforeSendHeaders.addListener(
|
|
91
|
+
this.onBeforeSendHeaders,
|
|
92
|
+
{ urls },
|
|
93
|
+
blockingWebRequest
|
|
94
|
+
? Object.values(chrome.webRequest.OnBeforeSendHeadersOptions)
|
|
95
|
+
: undefined,
|
|
96
|
+
);
|
|
97
|
+
chrome.webRequest.onHeadersReceived.addListener(
|
|
98
|
+
this.onHeadersReceived,
|
|
99
|
+
{ urls },
|
|
100
|
+
blockingWebRequest
|
|
101
|
+
? Object.values(chrome.webRequest.OnHeadersReceivedOptions)
|
|
102
|
+
: undefined,
|
|
103
|
+
);
|
|
104
|
+
chrome.webRequest.onCompleted.addListener(this.onCompleted, { urls });
|
|
105
|
+
chrome.webRequest.onErrorOccurred.addListener(this.onErrorOccurred, {
|
|
106
|
+
urls,
|
|
107
|
+
});
|
|
78
108
|
}
|
|
79
109
|
|
|
80
110
|
#reportTrackerInteraction(kind, state) {
|
|
@@ -245,39 +275,11 @@ export default class RequestReporter {
|
|
|
245
275
|
);
|
|
246
276
|
await this.tokenChecker.init();
|
|
247
277
|
|
|
248
|
-
|
|
249
|
-
const blockingWebRequest = await chrome.permissions.contains({
|
|
250
|
-
permissions: ['webRequestBlocking'],
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
chrome.webRequest.onBeforeRequest.addListener(
|
|
254
|
-
this.onBeforeRequest,
|
|
255
|
-
{ urls },
|
|
256
|
-
blockingWebRequest
|
|
257
|
-
? Object.values(chrome.webRequest.OnBeforeRequestOptions)
|
|
258
|
-
: undefined,
|
|
259
|
-
);
|
|
260
|
-
chrome.webRequest.onBeforeSendHeaders.addListener(
|
|
261
|
-
this.onBeforeSendHeaders,
|
|
262
|
-
{ urls },
|
|
263
|
-
blockingWebRequest
|
|
264
|
-
? Object.values(chrome.webRequest.OnBeforeSendHeadersOptions)
|
|
265
|
-
: undefined,
|
|
266
|
-
);
|
|
267
|
-
chrome.webRequest.onHeadersReceived.addListener(
|
|
268
|
-
this.onHeadersReceived,
|
|
269
|
-
{ urls },
|
|
270
|
-
blockingWebRequest
|
|
271
|
-
? Object.values(chrome.webRequest.OnHeadersReceivedOptions)
|
|
272
|
-
: undefined,
|
|
273
|
-
);
|
|
274
|
-
chrome.webRequest.onCompleted.addListener(this.onCompleted, { urls });
|
|
275
|
-
chrome.webRequest.onErrorOccurred.addListener(this.onErrorOccurred, {
|
|
276
|
-
urls,
|
|
277
|
-
});
|
|
278
|
+
this.ready = true;
|
|
278
279
|
}
|
|
279
280
|
|
|
280
281
|
unload() {
|
|
282
|
+
this.ready = false;
|
|
281
283
|
if (this.qs_whitelist) {
|
|
282
284
|
this.qs_whitelist.destroy();
|
|
283
285
|
}
|
|
@@ -307,6 +309,7 @@ export default class RequestReporter {
|
|
|
307
309
|
}
|
|
308
310
|
|
|
309
311
|
onBeforeRequest = (details) => {
|
|
312
|
+
if (!this.ready) return;
|
|
310
313
|
const state = WebRequestContext.fromDetails(details, this.pageStore);
|
|
311
314
|
const response = new BlockingResponse(details, 'onBeforeRequest');
|
|
312
315
|
// checkState
|
|
@@ -393,6 +396,7 @@ export default class RequestReporter {
|
|
|
393
396
|
};
|
|
394
397
|
|
|
395
398
|
onBeforeSendHeaders = (details) => {
|
|
399
|
+
if (!this.ready) return;
|
|
396
400
|
const state = WebRequestContext.fromDetails(details, this.pageStore);
|
|
397
401
|
const response = new BlockingResponse(details, 'onBeforeSendHeaders');
|
|
398
402
|
// checkState
|
|
@@ -478,6 +482,7 @@ export default class RequestReporter {
|
|
|
478
482
|
};
|
|
479
483
|
|
|
480
484
|
onHeadersReceived = (details) => {
|
|
485
|
+
if (!this.ready) return;
|
|
481
486
|
const state = WebRequestContext.fromDetails(details, this.pageStore);
|
|
482
487
|
const response = new BlockingResponse(details, 'onHeadersReceived');
|
|
483
488
|
// checkState
|
|
@@ -541,6 +546,7 @@ export default class RequestReporter {
|
|
|
541
546
|
};
|
|
542
547
|
|
|
543
548
|
onCompleted = (details) => {
|
|
549
|
+
if (!this.ready) return;
|
|
544
550
|
this.whitelistedRequestCache.delete(details.requestId);
|
|
545
551
|
const state = WebRequestContext.fromDetails(details, this.pageStore);
|
|
546
552
|
// checkState
|
|
@@ -556,6 +562,7 @@ export default class RequestReporter {
|
|
|
556
562
|
};
|
|
557
563
|
|
|
558
564
|
onErrorOccurred = (details) => {
|
|
565
|
+
if (!this.ready) return;
|
|
559
566
|
this.whitelistedRequestCache.delete(details.requestId);
|
|
560
567
|
};
|
|
561
568
|
|
|
@@ -164,7 +164,7 @@ export default class CachedEntryPipeline {
|
|
|
164
164
|
});
|
|
165
165
|
// push first maxSending entries to input queue
|
|
166
166
|
queuedForSending.splice(maxSending);
|
|
167
|
-
queuedForSending.forEach((v) => this.
|
|
167
|
+
queuedForSending.forEach((v) => this.processEntry.pub(v));
|
|
168
168
|
// delete old entries
|
|
169
169
|
this.db.bulkDelete(toBeDeleted);
|
|
170
170
|
// check the cache for items to persist to the db.
|
|
@@ -65,6 +65,7 @@ describe('request/index', function () {
|
|
|
65
65
|
// Thus, leaving the old way to monkey patch, even though it may
|
|
66
66
|
// indicate that there are bugs in the implementation or in the tests.
|
|
67
67
|
chrome.storage.session = chrome.storage.local;
|
|
68
|
+
chrome.runtime.getManifest.returns({ permissions: [] });
|
|
68
69
|
chrome.storage.session.get.yields({});
|
|
69
70
|
chrome.tabs.query.returns([]);
|
|
70
71
|
|