@whotracksme/reporting 5.1.29 → 5.1.30

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 (55) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +1 -1
  3. package/reporting/example/index.js +2 -12
  4. package/reporting/example/manifests/chromium.json +1 -0
  5. package/reporting/snapshots/0001/snapshot.json +1 -1
  6. package/reporting/snapshots/0002/snapshot.json +2 -2
  7. package/reporting/snapshots/0003/events.log.br +0 -0
  8. package/reporting/snapshots/0003/snapshot.json +855 -0
  9. package/reporting/snapshots/0004/events.log.br +0 -0
  10. package/reporting/snapshots/0004/snapshot.json +802 -0
  11. package/reporting/src/hash-detector.js +1 -1
  12. package/reporting/src/index.js +1 -2
  13. package/reporting/src/request/config.js +9 -4
  14. package/reporting/src/request/{hash.js → hash/index.js} +3 -3
  15. package/reporting/src/request/index.js +445 -494
  16. package/reporting/src/{webrequest-pipeline → request}/page-store.js +65 -75
  17. package/reporting/src/request/qs-whitelist2.js +0 -2
  18. package/reporting/src/request/steps/cookie-context.js +6 -5
  19. package/reporting/src/request/steps/oauth-detector.js +3 -24
  20. package/reporting/src/request/steps/page-logger.js +3 -4
  21. package/reporting/src/request/steps/token-checker/token-domain.js +1 -1
  22. package/reporting/src/request/steps/token-examiner.js +3 -4
  23. package/reporting/src/request/steps/token-telemetry/cached-entry-pipeline.js +52 -68
  24. package/reporting/src/request/steps/token-telemetry/index.js +86 -113
  25. package/reporting/src/request/steps/token-telemetry/key-pipeline.js +3 -2
  26. package/reporting/src/request/steps/token-telemetry/token-pipeline.js +3 -2
  27. package/reporting/src/request/utils/temp-set.js +2 -4
  28. package/reporting/src/request/{time.js → utils/time.js} +0 -5
  29. package/reporting/src/request/utils/tlds.js +1 -11
  30. package/reporting/src/request/{utils.js → utils/utils.js} +9 -0
  31. package/reporting/src/{webrequest-pipeline/webrequest-context.js → request/utils/webrequest.js} +84 -4
  32. package/reporting/src/utils/url.js +0 -25
  33. package/reporting/test/helpers/scenarios.js +1 -1
  34. package/reporting/test/index.js +3 -8
  35. package/reporting/test/request/{hash.spec.js → hash/index.spec.js} +2 -2
  36. package/reporting/test/request/index.spec.js +23 -46
  37. package/reporting/test/{request-reporter.test.js → request/index.test.js} +13 -17
  38. package/reporting/test/{webrequest-pipeline → request}/page-store.test.js +1 -1
  39. package/reporting/test/request/steps/oauth-detector.spec.js +15 -25
  40. package/reporting/test/request/{utils.spec.js → utils/utils.spec.js} +2 -2
  41. package/reporting/test/utils/url.spec.js +1 -26
  42. package/reporting/src/request/page-telemetry.js +0 -42
  43. package/reporting/src/request/steps/subdomain-check.js +0 -34
  44. package/reporting/src/request/utils/subject.js +0 -37
  45. package/reporting/src/request-reporter.js +0 -111
  46. package/reporting/src/utils/pacemaker.js +0 -279
  47. package/reporting/src/webrequest-pipeline/cname-uncloak.js +0 -110
  48. package/reporting/src/webrequest-pipeline/index.js +0 -286
  49. package/reporting/src/webrequest-pipeline/logger.js +0 -14
  50. package/reporting/src/webrequest-pipeline/pipeline.js +0 -249
  51. package/reporting/src/webrequest-pipeline/utils/webrequest.js +0 -119
  52. package/reporting/test/utils/pacemaker.spec.js +0 -222
  53. package/reporting/test/webrequest-pipeline/index.test.js +0 -160
  54. package/reporting/test/webrequest-pipeline/pipeline.spec.js +0 -251
  55. /package/reporting/src/request/{resources → hash}/prob.js +0 -0
@@ -1502,7 +1502,7 @@ const probHashChars = {
1502
1502
  'Z': 61,
1503
1503
  };
1504
1504
 
1505
- export function isHashProb(str) {
1505
+ function isHashProb(str) {
1506
1506
  str = str.replace(/[^A-Za-z0-9]/g, '');
1507
1507
 
1508
1508
  let logProb = 0.0;
@@ -9,6 +9,5 @@
9
9
  * file, You can obtain one at http://mozilla.org/MPL/2.0
10
10
  */
11
11
  export { default as UrlReporter } from './reporting';
12
- export { default as RequestReporter } from './request-reporter';
13
- export { default as WebRequestPipeline } from './webrequest-pipeline';
12
+ export { default as RequestReporter } from './request/index';
14
13
  export { setLogLevel, describeLoggers } from './logger';
@@ -9,7 +9,6 @@
9
9
  * file, You can obtain one at http://mozilla.org/MPL/2.0
10
10
  */
11
11
 
12
- import pacemaker from '../utils/pacemaker.js';
13
12
  import logger from '../logger.js';
14
13
 
15
14
  const RETRY_TIMEOUT = 30 * 1000;
@@ -21,7 +20,7 @@ export const COOKIE_MODE = {
21
20
  TRACKERS: 'trackers',
22
21
  };
23
22
 
24
- export const DEFAULTS = {
23
+ const DEFAULTS = {
25
24
  safekeyValuesThreshold: 4,
26
25
  shortTokenLength: 6,
27
26
  placeHolder: 'ghostery',
@@ -80,7 +79,10 @@ export default class Config {
80
79
  await this._loadConfig();
81
80
  }
82
81
 
83
- unload() {}
82
+ unload() {
83
+ clearTimeout(this._retryTimeout);
84
+ this._retryTimeout = null;
85
+ }
84
86
 
85
87
  async _loadConfig() {
86
88
  await this.db.ready;
@@ -104,7 +106,10 @@ export default class Config {
104
106
  });
105
107
  } catch (e) {
106
108
  logger.error('could not load request config', e);
107
- pacemaker.setTimeout(this._loadConfig.bind(this), RETRY_TIMEOUT);
109
+ this._retryTimeout = setTimeout(
110
+ this._loadConfig.bind(this),
111
+ RETRY_TIMEOUT,
112
+ );
108
113
  }
109
114
  }
110
115
 
@@ -11,8 +11,8 @@
11
11
 
12
12
  /* eslint no-param-reassign: 'off' */
13
13
 
14
- import { isIpv4Address } from '../utils/url.js';
15
- import prob from './resources/prob.js';
14
+ import { isIpv4Address } from '../utils/utils.js';
15
+ import prob from './prob.js';
16
16
 
17
17
  export class HashProb {
18
18
  constructor() {
@@ -72,7 +72,7 @@ export function isMostlyNumeric(str) {
72
72
  const BEGIN_DATE = new Date(2010, 1, 1).getTime();
73
73
  const END_DATE = Date.now() + 1000 * 60 * 60 * 24 * 365 * 5; // now + 5 YEARS;
74
74
 
75
- export function isTimestamp(str) {
75
+ function isTimestamp(str) {
76
76
  const intVal = parseInt(str, 10);
77
77
  return !isNaN(intVal) && intVal > BEGIN_DATE && intVal < END_DATE;
78
78
  }