@duckduckgo/autoconsent 16.45.0 → 16.47.0

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 (57) hide show
  1. package/.github/dependabot.yml +6 -0
  2. package/.github/labeler.yml +1 -1
  3. package/.github/workflows/release-labels.yml +19 -11
  4. package/CHANGELOG.md +51 -0
  5. package/dist/addon-firefox/compact-rules.json +1 -1
  6. package/dist/addon-firefox/content.bundle.js +5 -3
  7. package/dist/addon-firefox/manifest.json +1 -1
  8. package/dist/addon-firefox/rule-index.json +1 -1
  9. package/dist/addon-firefox/rules.json +1 -1
  10. package/dist/addon-mv3/compact-rules.json +1 -1
  11. package/dist/addon-mv3/content.bundle.js +5 -3
  12. package/dist/addon-mv3/manifest.json +1 -1
  13. package/dist/addon-mv3/rule-index.json +1 -1
  14. package/dist/addon-mv3/rules.json +1 -1
  15. package/dist/autoconsent.cjs.js +5 -3
  16. package/dist/autoconsent.esm.js +5 -3
  17. package/dist/autoconsent.playwright.js +5 -3
  18. package/dist/autoconsent.standalone.js +6 -4
  19. package/lib/encoding.ts +1 -8
  20. package/lib/heuristic-patterns.ts +1 -1
  21. package/lib/messages.ts +1 -6
  22. package/lib/web.ts +5 -4
  23. package/package.json +6 -6
  24. package/playwright/runner.ts +13 -0
  25. package/rules/autoconsent/controlgame.json +12 -0
  26. package/rules/autoconsent/cookieyes.json +3 -1
  27. package/rules/autoconsent/cookiez.json +9 -0
  28. package/rules/autoconsent/cuvva.com.json +55 -0
  29. package/rules/autoconsent/dalecarnegie.json +44 -0
  30. package/rules/autoconsent/fanatics.json +9 -0
  31. package/rules/autoconsent/jpmorgan-chase.json +10 -0
  32. package/rules/autoconsent/lego.json +26 -0
  33. package/rules/autoconsent/privacy-area.json +56 -0
  34. package/rules/autoconsent/securiti-gpc-flyout.json +22 -0
  35. package/rules/autoconsent/speciesplus.json +10 -0
  36. package/rules/autoconsent/squarespace-cookie-banner.json +24 -1
  37. package/rules/autoconsent/ziptozipmoving.json +44 -0
  38. package/rules/compact-rules.json +1 -1
  39. package/rules/rule-index.json +1 -1
  40. package/rules/rules.json +1 -1
  41. package/tests/controlgame.spec.ts +3 -0
  42. package/tests/cookieyes.spec.ts +2 -0
  43. package/tests/cookiez.spec.ts +12 -0
  44. package/tests/cuvva.com.spec.ts +4 -0
  45. package/tests/dalecarnegie.spec.ts +3 -0
  46. package/tests/fanatics.spec.ts +9 -0
  47. package/tests/jpmorgan-chase.spec.ts +8 -0
  48. package/tests/lego.spec.ts +8 -0
  49. package/tests/privacy-area.spec.ts +9 -0
  50. package/tests/securiti-gpc-flyout.spec.ts +21 -0
  51. package/tests/speciesplus.spec.ts +3 -0
  52. package/tests/squarespace-cookie-banner.spec.ts +8 -1
  53. package/tests/ziptozipmoving.spec.ts +5 -0
  54. package/tests-wtr/heuristics/heuristics-utils.test.ts +6 -0
  55. package/tests-wtr/lifecycle/find-cmp.ts +13 -0
  56. package/tsconfig.build.json +1 -0
  57. package/tsconfig.json +2 -1
@@ -472,7 +472,7 @@ var DETECT_PATTERNS = [
472
472
  // "only necessary" is probably too broad
473
473
  /(?:by continuing.{0,100}cookie)|(?:cookie.{0,100}by continuing)/gi,
474
474
  /(?:by continuing.{0,100}privacy)|(?:privacy.{0,100}by continuing)/gi,
475
- /we (?:use|serve)(?: optional)? cookies/gi,
475
+ /we (?:use|serve)(?: optional| essential)? cookies/gi,
476
476
  /we are using cookies/gi,
477
477
  /use of cookies/gi,
478
478
  /website uses cookies to enhance your browsing experience/gi,
@@ -3331,7 +3331,8 @@ var AutoConsent = class {
3331
3331
  }
3332
3332
  }
3333
3333
  });
3334
- const heuristicRules = isTop && this.config.heuristicMode !== "off" && this.state.findCmpAttempts % 2 === 0 ? [new AutoConsentHeuristicCMP(this, this.config.heuristicMode)] : [];
3334
+ const heuristicEnabled = isTop && this.config.heuristicMode !== "off";
3335
+ const heuristicRules = heuristicEnabled && this.state.findCmpAttempts % 2 === 0 ? [new AutoConsentHeuristicCMP(this, this.config.heuristicMode)] : [];
3335
3336
  const rulesPriorityStages = [
3336
3337
  ["site-specific", siteSpecificRules],
3337
3338
  ["generic", genericRules],
@@ -3372,7 +3373,8 @@ var AutoConsent = class {
3372
3373
  this.detectHeuristics();
3373
3374
  if (foundCMPs.length === 0 && retries > 0) {
3374
3375
  const waitFor2 = [this.domActions.wait(500)];
3375
- if (this.state.findCmpAttempts > 1) {
3376
+ const heuristicSkipped = heuristicEnabled && heuristicRules.length === 0;
3377
+ if (this.state.findCmpAttempts > 1 && !heuristicSkipped) {
3376
3378
  waitFor2.push(mutationObserver);
3377
3379
  }
3378
3380
  try {
@@ -442,7 +442,7 @@ var DETECT_PATTERNS = [
442
442
  // "only necessary" is probably too broad
443
443
  /(?:by continuing.{0,100}cookie)|(?:cookie.{0,100}by continuing)/gi,
444
444
  /(?:by continuing.{0,100}privacy)|(?:privacy.{0,100}by continuing)/gi,
445
- /we (?:use|serve)(?: optional)? cookies/gi,
445
+ /we (?:use|serve)(?: optional| essential)? cookies/gi,
446
446
  /we are using cookies/gi,
447
447
  /use of cookies/gi,
448
448
  /website uses cookies to enhance your browsing experience/gi,
@@ -3301,7 +3301,8 @@ var AutoConsent = class {
3301
3301
  }
3302
3302
  }
3303
3303
  });
3304
- const heuristicRules = isTop && this.config.heuristicMode !== "off" && this.state.findCmpAttempts % 2 === 0 ? [new AutoConsentHeuristicCMP(this, this.config.heuristicMode)] : [];
3304
+ const heuristicEnabled = isTop && this.config.heuristicMode !== "off";
3305
+ const heuristicRules = heuristicEnabled && this.state.findCmpAttempts % 2 === 0 ? [new AutoConsentHeuristicCMP(this, this.config.heuristicMode)] : [];
3305
3306
  const rulesPriorityStages = [
3306
3307
  ["site-specific", siteSpecificRules],
3307
3308
  ["generic", genericRules],
@@ -3342,7 +3343,8 @@ var AutoConsent = class {
3342
3343
  this.detectHeuristics();
3343
3344
  if (foundCMPs.length === 0 && retries > 0) {
3344
3345
  const waitFor2 = [this.domActions.wait(500)];
3345
- if (this.state.findCmpAttempts > 1) {
3346
+ const heuristicSkipped = heuristicEnabled && heuristicRules.length === 0;
3347
+ if (this.state.findCmpAttempts > 1 && !heuristicSkipped) {
3346
3348
  waitFor2.push(mutationObserver);
3347
3349
  }
3348
3350
  try {
@@ -444,7 +444,7 @@
444
444
  // "only necessary" is probably too broad
445
445
  /(?:by continuing.{0,100}cookie)|(?:cookie.{0,100}by continuing)/gi,
446
446
  /(?:by continuing.{0,100}privacy)|(?:privacy.{0,100}by continuing)/gi,
447
- /we (?:use|serve)(?: optional)? cookies/gi,
447
+ /we (?:use|serve)(?: optional| essential)? cookies/gi,
448
448
  /we are using cookies/gi,
449
449
  /use of cookies/gi,
450
450
  /website uses cookies to enhance your browsing experience/gi,
@@ -3071,7 +3071,8 @@
3071
3071
  }
3072
3072
  }
3073
3073
  });
3074
- const heuristicRules = isTop && this.config.heuristicMode !== "off" && this.state.findCmpAttempts % 2 === 0 ? [new AutoConsentHeuristicCMP(this, this.config.heuristicMode)] : [];
3074
+ const heuristicEnabled = isTop && this.config.heuristicMode !== "off";
3075
+ const heuristicRules = heuristicEnabled && this.state.findCmpAttempts % 2 === 0 ? [new AutoConsentHeuristicCMP(this, this.config.heuristicMode)] : [];
3075
3076
  const rulesPriorityStages = [
3076
3077
  ["site-specific", siteSpecificRules],
3077
3078
  ["generic", genericRules],
@@ -3112,7 +3113,8 @@
3112
3113
  this.detectHeuristics();
3113
3114
  if (foundCMPs.length === 0 && retries > 0) {
3114
3115
  const waitFor2 = [this.domActions.wait(500)];
3115
- if (this.state.findCmpAttempts > 1) {
3116
+ const heuristicSkipped = heuristicEnabled && heuristicRules.length === 0;
3117
+ if (this.state.findCmpAttempts > 1 && !heuristicSkipped) {
3116
3118
  waitFor2.push(mutationObserver);
3117
3119
  }
3118
3120
  try {