@whotracksme/reporting 5.1.28 → 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 (59) hide show
  1. package/CHANGELOG.md +37 -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/events.log.br +0 -0
  6. package/reporting/snapshots/0001/snapshot.json +4173 -0
  7. package/reporting/snapshots/0002/events.log.br +0 -0
  8. package/reporting/snapshots/0002/snapshot.json +2539 -0
  9. package/reporting/snapshots/0003/events.log.br +0 -0
  10. package/reporting/snapshots/0003/snapshot.json +855 -0
  11. package/reporting/snapshots/0004/events.log.br +0 -0
  12. package/reporting/snapshots/0004/snapshot.json +802 -0
  13. package/reporting/src/hash-detector.js +1 -1
  14. package/reporting/src/index.js +1 -2
  15. package/reporting/src/request/config.js +9 -4
  16. package/reporting/src/request/{hash.js → hash/index.js} +3 -3
  17. package/reporting/src/request/index.js +447 -496
  18. package/reporting/src/{webrequest-pipeline → request}/page-store.js +65 -75
  19. package/reporting/src/request/qs-whitelist2.js +0 -2
  20. package/reporting/src/request/steps/cookie-context.js +6 -5
  21. package/reporting/src/request/steps/oauth-detector.js +3 -24
  22. package/reporting/src/request/steps/page-logger.js +3 -4
  23. package/reporting/src/request/steps/token-checker/token-domain.js +1 -1
  24. package/reporting/src/request/steps/token-examiner.js +3 -4
  25. package/reporting/src/request/steps/token-telemetry/cached-entry-pipeline.js +55 -75
  26. package/reporting/src/request/steps/token-telemetry/index.js +86 -115
  27. package/reporting/src/request/steps/token-telemetry/key-pipeline.js +3 -2
  28. package/reporting/src/request/steps/token-telemetry/token-pipeline.js +3 -2
  29. package/reporting/src/request/utils/temp-set.js +2 -4
  30. package/reporting/src/request/{time.js → utils/time.js} +0 -5
  31. package/reporting/src/request/utils/tlds.js +1 -11
  32. package/reporting/src/request/{utils.js → utils/utils.js} +9 -0
  33. package/reporting/src/{webrequest-pipeline/webrequest-context.js → request/utils/webrequest.js} +84 -4
  34. package/reporting/src/utils/url.js +0 -25
  35. package/reporting/test/helpers/scenarios.js +76 -17
  36. package/reporting/test/index.js +3 -8
  37. package/reporting/test/request/database.test.js +96 -0
  38. package/reporting/test/request/{hash.spec.js → hash/index.spec.js} +2 -2
  39. package/reporting/test/request/index.spec.js +24 -46
  40. package/reporting/test/{request-reporter.test.js → request/index.test.js} +102 -46
  41. package/reporting/test/{webrequest-pipeline → request}/page-store.test.js +1 -1
  42. package/reporting/test/request/steps/oauth-detector.spec.js +15 -25
  43. package/reporting/test/request/{utils.spec.js → utils/utils.spec.js} +2 -2
  44. package/reporting/test/setup.unit.js +1 -0
  45. package/reporting/test/utils/url.spec.js +1 -26
  46. package/reporting/src/request/page-telemetry.js +0 -42
  47. package/reporting/src/request/steps/subdomain-check.js +0 -34
  48. package/reporting/src/request/utils/subject.js +0 -37
  49. package/reporting/src/request-reporter.js +0 -111
  50. package/reporting/src/utils/pacemaker.js +0 -279
  51. package/reporting/src/webrequest-pipeline/cname-uncloak.js +0 -110
  52. package/reporting/src/webrequest-pipeline/index.js +0 -286
  53. package/reporting/src/webrequest-pipeline/logger.js +0 -14
  54. package/reporting/src/webrequest-pipeline/pipeline.js +0 -249
  55. package/reporting/src/webrequest-pipeline/utils/webrequest.js +0 -119
  56. package/reporting/test/utils/pacemaker.spec.js +0 -222
  57. package/reporting/test/webrequest-pipeline/index.test.js +0 -160
  58. package/reporting/test/webrequest-pipeline/pipeline.spec.js +0 -251
  59. /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
  }