@whotracksme/reporting 6.2.0 โ†’ 6.3.1

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,32 @@
1
+ # v6.3.1 (Wed Jan 29 2025)
2
+
3
+ #### ๐Ÿ› Bug Fix
4
+
5
+ - Fixed: TypeError: this.config is undefined [#155](https://github.com/whotracksme/webextension-packages/pull/155) ([@philipp-classen](https://github.com/philipp-classen))
6
+
7
+ #### Authors: 1
8
+
9
+ - Philipp ClaรŸen ([@philipp-classen](https://github.com/philipp-classen))
10
+
11
+ ---
12
+
13
+ # v6.3.0 (Wed Jan 29 2025)
14
+
15
+ #### ๐Ÿš€ Enhancement
16
+
17
+ - URL analyzer tweak [#154](https://github.com/whotracksme/webextension-packages/pull/154) ([@philipp-classen](https://github.com/philipp-classen))
18
+
19
+ #### ๐Ÿ› Bug Fix
20
+
21
+ - Request: fix unload [#153](https://github.com/whotracksme/webextension-packages/pull/153) ([@chrmod](https://github.com/chrmod))
22
+
23
+ #### Authors: 2
24
+
25
+ - Krzysztof Modras ([@chrmod](https://github.com/chrmod))
26
+ - Philipp ClaรŸen ([@philipp-classen](https://github.com/philipp-classen))
27
+
28
+ ---
29
+
1
30
  # v6.2.0 (Sun Jan 19 2025)
2
31
 
3
32
  #### ๐Ÿš€ Enhancement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whotracksme/reporting",
3
- "version": "6.2.0",
3
+ "version": "6.3.1",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "scripts": {
@@ -336,7 +336,7 @@ export function lookupBuiltinTransform(name) {
336
336
  * to disable clients that do not meet the minimum requirements of the
337
337
  * current patterns.
338
338
  */
339
- const PATTERN_DSL_VERSION = 4;
339
+ const PATTERN_DSL_VERSION = 5;
340
340
 
341
341
  /**
342
342
  * "Magic" empty rule set, which exists only if patterns were loaded, but
@@ -251,18 +251,12 @@ export default class RequestReporter {
251
251
 
252
252
  unload() {
253
253
  this.ready = false;
254
- if (this.qs_whitelist) {
255
- this.qs_whitelist.destroy();
256
- }
257
- if (this.cookieContext) {
258
- this.cookieContext.unload();
259
- }
260
- if (this.tokenExaminer) {
261
- this.tokenExaminer.unload();
262
- }
263
- if (this.tokenChecker) {
264
- this.tokenChecker.unload();
265
- }
254
+
255
+ this.config?.unload();
256
+ this.cookieContext?.unload();
257
+ this.tokenExaminer?.unload();
258
+ this.tokenChecker?.unload();
259
+ this.db?.unload();
266
260
 
267
261
  chrome.webRequest.onBeforeRequest.removeListener(this.onBeforeRequest);
268
262
  chrome.webRequest.onBeforeSendHeaders.removeListener(
@@ -272,9 +266,6 @@ export default class RequestReporter {
272
266
  chrome.webRequest.onCompleted.removeListener(this.onCompleted);
273
267
  chrome.webRequest.onErrorOccurred.removeListener(this.onErrorOccurred);
274
268
 
275
- if (this.db) {
276
- this.db.unload();
277
- }
278
269
  clearInterval(this.dayChangedInterval);
279
270
  this.dayChangedInterval = null;
280
271
  }
@@ -72,8 +72,11 @@ const URL_PATTERNS = [
72
72
  {
73
73
  category: 'search-dd',
74
74
  regexp:
75
- /^https:[/][/]duckduckgo[.]com[/](?:html$|.*[?&]q=[^&]+.*&ia=web|[?]q=[^&]+$)/,
76
- prefix: '?q=',
75
+ /^https:[/][/](?:html[.])?duckduckgo[.]com[/].*([?&]q=[^&]+.*&ia=web|[?]q=[^&]+$)/,
76
+ prefix: 'html?q=',
77
+ doublefetchHost() {
78
+ return 'html.duckduckgo.com';
79
+ },
77
80
  },
78
81
  {
79
82
  category: 'search-gh',
@@ -130,6 +133,7 @@ export default class UrlAnalyzer {
130
133
  regexp,
131
134
  prefix,
132
135
  queryFinder = (parsedUrl) => parsedUrl.searchParams.get('q'),
136
+ doublefetchHost = (parsedUrl) => parsedUrl.host,
133
137
  } of this._urlPatterns) {
134
138
  if (regexp.test(url)) {
135
139
  // Workaround for an encoding issue (source: https://stackoverflow.com/a/24417399/783510).
@@ -144,7 +148,8 @@ export default class UrlAnalyzer {
144
148
  return { isSupported: false };
145
149
  }
146
150
  const query_ = encodeURIComponent(query).replaceAll('%20', '+');
147
- const doublefetchUrl = `https://${parsedUrl.host}/${prefix}${query_}`;
151
+ const host_ = doublefetchHost(parsedUrl);
152
+ const doublefetchUrl = `https://${host_}/${prefix}${query_}`;
148
153
  const doublefetchRequest = this.patterns.createDoublefetchRequest(
149
154
  category,
150
155
  doublefetchUrl,
@@ -227,15 +227,23 @@ describe('#UrlAnalyzer', function () {
227
227
  'search-dd': {
228
228
  'https://duckduckgo.com/?q=eiffel+tower&t=h_&ia=web': {
229
229
  query: 'eiffel tower',
230
- doublefetchUrl: 'https://duckduckgo.com/?q=eiffel+tower',
230
+ doublefetchUrl: 'https://html.duckduckgo.com/html?q=eiffel+tower',
231
231
  },
232
232
  'https://duckduckgo.com/?t=ffab&q=eiffel+tower&ia=web': {
233
233
  query: 'eiffel tower',
234
- doublefetchUrl: 'https://duckduckgo.com/?q=eiffel+tower',
234
+ doublefetchUrl: 'https://html.duckduckgo.com/html?q=eiffel+tower',
235
235
  },
236
236
  'https://duckduckgo.com/?q=eiffel+tower': {
237
237
  query: 'eiffel tower',
238
- doublefetchUrl: 'https://duckduckgo.com/?q=eiffel+tower',
238
+ doublefetchUrl: 'https://html.duckduckgo.com/html?q=eiffel+tower',
239
+ },
240
+ 'https://duckduckgo.com/html?q=eiffel+tower': {
241
+ query: 'eiffel tower',
242
+ doublefetchUrl: 'https://html.duckduckgo.com/html?q=eiffel+tower',
243
+ },
244
+ 'https://html.duckduckgo.com/html?q=eiffel+tower': {
245
+ query: 'eiffel tower',
246
+ doublefetchUrl: 'https://html.duckduckgo.com/html?q=eiffel+tower',
239
247
  },
240
248
  },
241
249
  })) {