@whotracksme/reporting 12.1.4 → 12.1.6

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/communication/karma.conf.cjs +1 -1
  3. package/communication/package.json +9 -10
  4. package/communication/rollup.common-config.cjs +19 -3
  5. package/communication/src/padding.js +0 -2
  6. package/communication/src/zlib.js +1 -1
  7. package/eslint.config.js +34 -0
  8. package/package.json +15 -13
  9. package/reporting/karma.conf.cjs +1 -1
  10. package/reporting/package.json +21 -22
  11. package/reporting/rollup.common-config.cjs +19 -3
  12. package/reporting/src/alive-message-generator.js +1 -1
  13. package/reporting/src/doublefetch-page-handler.js +2 -2
  14. package/reporting/src/duplicate-detector.js +1 -3
  15. package/reporting/src/hash-detector-v2/index.js +1 -1
  16. package/reporting/src/http.js +2 -3
  17. package/reporting/src/md5.js +0 -1
  18. package/reporting/src/message-sender.js +2 -3
  19. package/reporting/src/nav-tracking-detector.js +2 -2
  20. package/reporting/src/network.js +1 -1
  21. package/reporting/src/page-aggregator.js +1 -1
  22. package/reporting/src/page-quorum-check-handler.js +1 -1
  23. package/reporting/src/page-structure.js +1 -1
  24. package/reporting/src/pagedb.js +1 -1
  25. package/reporting/src/pages.js +2 -2
  26. package/reporting/src/patterns-updater.js +1 -1
  27. package/reporting/src/patterns.js +11 -11
  28. package/reporting/src/popularity-estimator.js +1 -1
  29. package/reporting/src/random.js +0 -2
  30. package/reporting/src/request/index.js +0 -1
  31. package/reporting/src/request/qs-whitelist2.js +4 -5
  32. package/reporting/src/request/utils/bloom-filter-packed.js +2 -2
  33. package/reporting/src/request/utils/chrome-storage-map.js +7 -4
  34. package/reporting/src/request/utils/time.js +5 -22
  35. package/reporting/src/sanitizer.js +1 -1
  36. package/reporting/src/search-extractor.js +2 -5
  37. package/reporting/src/url-cleaner.js +9 -6
  38. package/reporting/src/utils/url.js +2 -2
  39. package/reporting/test/activity-estimator.spec.js +9 -6
  40. package/reporting/test/duplicate-detector.spec.js +0 -1
  41. package/reporting/test/helpers/fast-check-utils.js +11 -0
  42. package/reporting/test/job-scheduler.spec.js +7 -1
  43. package/reporting/test/pagedb.spec.js +3 -1
  44. package/reporting/test/pages.spec.js +1 -1
  45. package/reporting/test/patterns-updater.spec.js +1 -1
  46. package/reporting/test/patterns.spec.js +28 -26
  47. package/reporting/test/persisted-counters.spec.js +2 -3
  48. package/reporting/test/popularity-estimator.spec.js +6 -0
  49. package/reporting/test/request/index.test.js +0 -1
  50. package/reporting/test/sanitizer.spec.js +4 -2
  51. package/reporting/test/search-extractor.spec.js +1 -1
  52. package/reporting/test/seq-executor.spec.js +2 -2
  53. package/reporting/test/url-analyzer.spec.js +3 -1
  54. package/reporting/test/url-cleaner.spec.js +21 -0
  55. package/reporting/test/utils/url.spec.js +0 -1
  56. package/reporting/test/utils.spec.js +1 -1
  57. package/.eslintignore +0 -4
  58. package/.eslintrc +0 -16
@@ -26,6 +26,27 @@ describe('#removeQueryParams', function () {
26
26
  removeQueryParams('https://example.test/path?foo=1&bar=2#baz', ['foo']),
27
27
  ).to.eql('https://example.test/path?bar=2#baz');
28
28
  });
29
+
30
+ it('should not treat a "?" in the fragment as a query', function () {
31
+ expect(removeQueryParams('https://example.test/#?foo=1', ['foo'])).to.eql(
32
+ 'https://example.test/#?foo=1',
33
+ );
34
+ expect(
35
+ removeQueryParams('https://example.test/#/path?foo=1&bar=2', ['foo']),
36
+ ).to.eql('https://example.test/#/path?foo=1&bar=2');
37
+ expect(removeQueryParams('https://example.test/#?&', [''])).to.eql(
38
+ 'https://example.test/#?&',
39
+ );
40
+ expect(
41
+ removeQueryParams('https://example.test/?foo=1#?foo=1', ['foo']),
42
+ ).to.eql('https://example.test/#?foo=1');
43
+ });
44
+
45
+ it('should support complex examples with "?" and "#" appearing again in the fragment', function () {
46
+ expect(
47
+ removeQueryParams('https://example.test/a?b#c?d#e', ['b', 'c', 'd']),
48
+ ).to.eql('https://example.test/a#c?d#e');
49
+ });
29
50
  });
30
51
 
31
52
  describe('should handle non-valid URLs gracefully', function () {
@@ -514,7 +514,6 @@ const keyValueTestCases = [
514
514
 
515
515
  function fillInSpec(spec) {
516
516
  Object.keys(emptyParts).forEach(function (k) {
517
- // eslint-disable-next-line no-param-reassign
518
517
  spec[k] = spec[k] || emptyParts[k];
519
518
  });
520
519
  return spec;
@@ -357,7 +357,7 @@ describe('#lazyInitAsync', function () {
357
357
  for (let i = 0; i < 3; i += 1) {
358
358
  try {
359
359
  await Promise.all([x(), x(), x()]);
360
- } catch (e) {
360
+ } catch {
361
361
  // expected to throw
362
362
  }
363
363
  }
package/.eslintignore DELETED
@@ -1,4 +0,0 @@
1
- **/*.bundle.js
2
- **/trackers-preview-generated.js
3
- **/scripts/**/*.js
4
- reporting/example/offscreen/**
package/.eslintrc DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "env": {
3
- "es2022": true,
4
- "browser": true,
5
- "serviceworker": true,
6
- "webextensions": true,
7
- "mocha": true
8
- },
9
- "extends": [
10
- "eslint:recommended",
11
- "plugin:prettier/recommended"
12
- ],
13
- "parserOptions": {
14
- "sourceType": "module"
15
- }
16
- }