@whotracksme/reporting 5.1.37 β†’ 5.1.38

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.38 (Fri Nov 22 2024)
2
+
3
+ #### πŸ› Bug Fix
4
+
5
+ - Update url classifier regexp [#140](https://github.com/whotracksme/webextension-packages/pull/140) ([@philipp-classen](https://github.com/philipp-classen))
6
+
7
+ #### 🏠 Internal
8
+
9
+ - Fixed errors when request reporter is not ready yet [#137](https://github.com/whotracksme/webextension-packages/pull/137) ([@philipp-classen](https://github.com/philipp-classen))
10
+
11
+ #### Authors: 1
12
+
13
+ - Philipp Claßen ([@philipp-classen](https://github.com/philipp-classen))
14
+
15
+ ---
16
+
1
17
  # v5.1.37 (Fri Nov 22 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.37",
3
+ "version": "5.1.38",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "scripts": {
@@ -307,7 +307,10 @@ export default class RequestReporter {
307
307
  }
308
308
 
309
309
  onBeforeRequest = (details) => {
310
- if (!this.ready) return;
310
+ if (!this.ready) {
311
+ logger.warn('onBeforeRequest skipped (not ready)');
312
+ return;
313
+ }
311
314
  const state = WebRequestContext.fromDetails(details, this.pageStore);
312
315
  const response = new BlockingResponse(details, 'onBeforeRequest');
313
316
  // checkState
@@ -393,7 +396,10 @@ export default class RequestReporter {
393
396
  };
394
397
 
395
398
  onBeforeSendHeaders = (details) => {
396
- if (!this.ready) return;
399
+ if (!this.ready) {
400
+ logger.warn('onBeforeSendHeaders skipped (not ready)');
401
+ return;
402
+ }
397
403
  const state = WebRequestContext.fromDetails(details, this.pageStore);
398
404
  const response = new BlockingResponse(details, 'onBeforeSendHeaders');
399
405
  // checkState
@@ -479,7 +485,10 @@ export default class RequestReporter {
479
485
  };
480
486
 
481
487
  onHeadersReceived = (details) => {
482
- if (!this.ready) return;
488
+ if (!this.ready) {
489
+ logger.warn('onHeadersReceived skipped (not ready)');
490
+ return;
491
+ }
483
492
  const state = WebRequestContext.fromDetails(details, this.pageStore);
484
493
  const response = new BlockingResponse(details, 'onHeadersReceived');
485
494
  // checkState
@@ -543,7 +552,10 @@ export default class RequestReporter {
543
552
  };
544
553
 
545
554
  onCompleted = (details) => {
546
- if (!this.ready) return;
555
+ if (!this.ready) {
556
+ logger.warn('onCompleted skipped (not ready)');
557
+ return;
558
+ }
547
559
  this.whitelistedRequestCache.delete(details.requestId);
548
560
  const state = WebRequestContext.fromDetails(details, this.pageStore);
549
561
  // checkState
@@ -559,7 +571,10 @@ export default class RequestReporter {
559
571
  };
560
572
 
561
573
  onErrorOccurred = (details) => {
562
- if (!this.ready) return;
574
+ if (!this.ready) {
575
+ logger.warn('onErrorOccurred skipped (not ready)');
576
+ return;
577
+ }
563
578
  this.whitelistedRequestCache.delete(details.requestId);
564
579
  };
565
580
 
@@ -709,6 +724,10 @@ export default class RequestReporter {
709
724
  }
710
725
 
711
726
  recordClick(event, context, href, sender) {
727
+ if (!this.ready) {
728
+ logger.warn('recordClick skipped (not ready)');
729
+ return;
730
+ }
712
731
  this.cookieContext.setContextFromEvent(event, context, href, sender);
713
732
  this.oAuthDetector.recordClick(sender);
714
733
  }
@@ -31,8 +31,8 @@ const URL_PATTERNS = [
31
31
  {
32
32
  category: 'search-gov',
33
33
  regexp:
34
- /^https:[/][/][^/]*[.]google[.].*?[#?&;]((q=[^&]+&([^&]+&)*tbm=vid)|(tbm=vid&([^&]+&)*q=[^&]+))/,
35
- prefix: 'search?tbm=vid&q=',
34
+ /^https:[/][/][^/]*[.]google[.].*?[#?&;]((q=[^&]+&([^&]+&)*udm=7)|(udm=7&([^&]+&)*q=[^&]+))/,
35
+ prefix: 'search?udm=7&q=',
36
36
  },
37
37
  {
38
38
  category: 'search-go',
@@ -83,21 +83,21 @@ describe('#UrlAnalyzer', function () {
83
83
  },
84
84
  },
85
85
  'search-gov': {
86
- 'https://www.google.com/search?q=cat&tbm=vid&ei=CWaMZMCpKMflkwWR3L_gCw&ved=0ahUKEwiA0uP_9Mf_AhXH8qQKHRHuD7wQ4dUDCAw&uact=5&oq=cat&gs_lcp=Cg1nd3Mtd2l6LXZpZGVvEAMyCwgAEIAEELEDEIMBMgsIABCABBCxAxCDATIHCAAQigUQQzILCAAQigUQsQMQgwEyBQgAEIAEMgUIABCABDILCAAQigUQsQMQgwEyBQgAEIAEMggIABCABBCxAzIICAAQgAQQsQM6CggAEIoFELEDEENQpQFY8gNg3ApoAHAAeACAAY8BiAGDA5IBAzMuMZgBAKABAcABAQ&sclient=gws-wiz-video':
86
+ 'https://www.google.com/search?sca_esv=332c1457e26e21ac&q=cat&udm=7&fbs=AEQNm0A6bwEop21ehxKWq5cj-cHa02QUie7apaStVTrDAEoT1CkRGSL-1wA3X2bR5dRYtRFmaZPN2OTOpML6Nzk89AWekIwYOcUmK2FR_flIZE9vn1EXAsBBBo_DOK7IqycIPr8oX9r_c2Y_H6YSW9sBv2zzlY5ifH_0oIYtOJi92VlQNOEZ0mbOIl6RYJLN-zdoMIA2J145wwYej0xWX2q5hfw8qzQw7g&sa=X&ved=2ahUKEwjPk4Dr2e-JAxWBgf0HHfEsNsYQtKgLegQIGhAB&biw=882&bih=1002&dpr=0.9':
87
87
  {
88
88
  query: 'cat',
89
- doublefetchUrl: 'https://www.google.com/search?tbm=vid&q=cat',
89
+ doublefetchUrl: 'https://www.google.com/search?udm=7&q=cat',
90
90
  },
91
- 'https://www.google.de/search?q=katze&tbm=vid&sa=X&ved=2ahUKEwi2xcvqgsj_AhWCcfEDHdmSBwwQ0pQJegQIBhAB&biw=1222&bih=976':
91
+ 'https://www.google.de/search?sca_esv=332c1457e26e21ac&q=katze&udm=7&fbs=AEQNm0A6bwEop21ehxKWq5cj-cHa02QUie7apaStVTrDAEoT1CkRGSL-1wA3X2bR5dRYtRGv3dh0WX48pQ0OijG3Ir_Ily36WNjIM66TUeQQm6v5pCxPr2gtqfjkC7ffv6Tr7pov6Kj4r20q4qdHCSHuZ8l9l_oCqEwoxOcaGtTQ9oNU0Tr95ug&sa=X&ved=2ahUKEwjDvfjh3u-JAxVY3AIHHUZkIcUQtKgLegQIIhAB&biw=958&bih=898&dpr=1':
92
92
  {
93
93
  query: 'katze',
94
- doublefetchUrl: 'https://www.google.de/search?tbm=vid&q=katze',
94
+ doublefetchUrl: 'https://www.google.de/search?udm=7&q=katze',
95
95
  },
96
- 'https://www.google.co.uk/search?q=British+Shorthair&tbm=vid&sa=X&ved=2ahUKEwjalvf9gsj_AhXB6aQKHVJqBzIQ0pQJegQIChAB&biw=1222&bih=976':
96
+ 'https://www.google.co.uk/search?sca_esv=332c1457e26e21ac&q=British+Shorthair&udm=7&fbs=AEQNm0A6bwEop21ehxKWq5cj-cHa02QUie7apaStVTrDAEoT1CkRGSL-1wA3X2bR5dRYtRGv3dh0WX48pQ0OijG3Ir_I75oFM8mN67hQ5D8L2f_4aId2Ld_vPyIeJPxAzy5CcO-5UtDBOirlUmpUozWrwxQJT3cKh-XbNOVVNXNxn1wGeq30DpZD8xJuzexvjnEe-Ql_N82o&sa=X&ved=2ahUKEwi5hIO_2u-JAxVm3AIHHXc1E7UQtKgLegQIEBAB':
97
97
  {
98
98
  query: 'British Shorthair',
99
99
  doublefetchUrl:
100
- 'https://www.google.co.uk/search?tbm=vid&q=British+Shorthair',
100
+ 'https://www.google.co.uk/search?udm=7&q=British+Shorthair',
101
101
  },
102
102
  },
103
103
  'search-go': {