@whotracksme/reporting 5.1.35 → 5.1.36

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 CHANGED
@@ -1,3 +1,19 @@
1
+ # v5.1.36 (Mon Nov 18 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Request: fix typo [#134](https://github.com/whotracksme/webextension-packages/pull/134) ([@chrmod](https://github.com/chrmod))
6
+
7
+ #### 🏠 Internal
8
+
9
+ - Request: remove remote blocking configuration [#133](https://github.com/whotracksme/webextension-packages/pull/133) ([@chrmod](https://github.com/chrmod))
10
+
11
+ #### Authors: 1
12
+
13
+ - Krzysztof Modras ([@chrmod](https://github.com/chrmod))
14
+
15
+ ---
16
+
1
17
  # v5.1.35 (Mon Nov 18 2024)
2
18
 
3
19
  #### 🐛 Bug Fix
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whotracksme/reporting",
3
- "version": "5.1.35",
3
+ "version": "5.1.36",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "scripts": {
@@ -36,12 +36,7 @@ const DEFAULTS = {
36
36
  * These are attributes which are loaded from the remote CONFIG_URL
37
37
  * @type {Array}
38
38
  */
39
- const REMOTELY_CONFIGURED = [
40
- 'blockRules',
41
- 'cookieWhitelist',
42
- 'subdomainRewriteRules',
43
- 'compatibilityList',
44
- ];
39
+ const REMOTELY_CONFIGURED = ['cookieWhitelist', 'compatibilityList'];
45
40
 
46
41
  export default class Config {
47
42
  constructor(
@@ -27,7 +27,6 @@ import { COOKIE_MODE, VERSION } from './config.js';
27
27
  import { shuffle } from './utils/utils.js';
28
28
  import random from '../random.js';
29
29
 
30
- import BlockRules from './steps/block-rules.js';
31
30
  import CookieContext from './steps/cookie-context.js';
32
31
  import PageLogger from './steps/page-logger.js';
33
32
  import TokenChecker from './steps/token-checker/index.js';
@@ -241,7 +240,6 @@ export default class RequestReporter {
241
240
  this.userAgent = (await this.getBrowserInfo()).name;
242
241
 
243
242
  this.pageLogger = new PageLogger(this.config.placeHolder);
244
- this.blockRules = new BlockRules(this.config);
245
243
  this.cookieContext = new CookieContext(this.config, this.qs_whitelist);
246
244
  await this.cookieContext.init();
247
245
 
@@ -381,10 +379,6 @@ export default class RequestReporter {
381
379
  if (this.isQSEnabled() === false) {
382
380
  return response.toWebRequestResponse();
383
381
  }
384
- // blockRules.applyBlockRules
385
- if (this.blockRules.applyBlockRules(state, response) === false) {
386
- return response.toWebRequestResponse();
387
- }
388
382
 
389
383
  this.#reportTrackerInteraction('fingerprint-removed', state);
390
384
 
@@ -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.processEntry.pub(v));
167
+ queuedForSending.forEach((v) => this.processEntry(v));
168
168
  // delete old entries
169
169
  this.db.bulkDelete(toBeDeleted);
170
170
  // check the cache for items to persist to the db.
@@ -1,40 +0,0 @@
1
- /**
2
- * WhoTracks.Me
3
- * https://whotracks.me/
4
- *
5
- * Copyright 2017-present Ghostery GmbH. All rights reserved.
6
- *
7
- * This Source Code Form is subject to the terms of the Mozilla Public
8
- * License, v. 2.0. If a copy of the MPL was not distributed with this
9
- * file, You can obtain one at http://mozilla.org/MPL/2.0
10
- */
11
-
12
- export default class BlockRules {
13
- constructor(config) {
14
- this.config = config;
15
- }
16
-
17
- get qsBlockRule() {
18
- return this.config.blockRules || [];
19
- }
20
-
21
- shouldBlock(host, sourceHost) {
22
- for (let i = 0; i < this.qsBlockRule.length; i += 1) {
23
- const sRule = this.qsBlockRule[i][0];
24
- const uRule = this.qsBlockRule[i][1];
25
- if (sourceHost.endsWith(sRule) && host.endsWith(uRule)) {
26
- return true;
27
- }
28
- }
29
- return false;
30
- }
31
-
32
- applyBlockRules(state, response) {
33
- if (this.shouldBlock(state.urlParts.hostname, state.tabUrlParts.hostname)) {
34
- state.incrementStat('req_rule_aborted');
35
- response.cancel = true;
36
- return false;
37
- }
38
- return true;
39
- }
40
- }