@duckduckgo/autoconsent 7.1.0 → 8.1.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 (91) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/Jenkinsfile +20 -37
  3. package/data/coverage.json +507 -531
  4. package/dist/addon-firefox/background.bundle.js +1 -0
  5. package/dist/addon-firefox/content.bundle.js +12 -15
  6. package/dist/addon-firefox/manifest.json +1 -1
  7. package/dist/addon-firefox/rules.json +127 -184
  8. package/dist/addon-mv3/background.bundle.js +1 -0
  9. package/dist/addon-mv3/content.bundle.js +12 -15
  10. package/dist/addon-mv3/manifest.json +1 -1
  11. package/dist/addon-mv3/rules.json +127 -184
  12. package/dist/autoconsent.cjs.js +12 -15
  13. package/dist/autoconsent.esm.js +12 -15
  14. package/dist/autoconsent.playwright.js +1 -1
  15. package/lib/cmps/cookiebot.ts +1 -4
  16. package/lib/cmps/evidon.ts +1 -1
  17. package/lib/cmps/trustarc-top.ts +1 -1
  18. package/lib/eval-snippets.ts +1 -0
  19. package/lib/rule-executors.ts +4 -4
  20. package/lib/rules.ts +1 -6
  21. package/lib/utils.ts +3 -5
  22. package/lib/web.ts +1 -1
  23. package/package.json +3 -2
  24. package/playwright/runner.ts +1 -0
  25. package/playwright.config.ts +0 -2
  26. package/readme.md +37 -28
  27. package/rules/autoconsent/1password-com.json +1 -1
  28. package/rules/autoconsent/agolde-com.json +1 -1
  29. package/rules/autoconsent/altium-com.json +1 -1
  30. package/rules/autoconsent/aquasana-com.json +1 -1
  31. package/rules/autoconsent/athlinks-com.json +1 -1
  32. package/rules/autoconsent/ausopen.json +1 -1
  33. package/rules/autoconsent/baden-wuerttemberg-de.json +1 -1
  34. package/rules/autoconsent/bbb.json +1 -1
  35. package/rules/autoconsent/burpee-com.json +1 -1
  36. package/rules/autoconsent/cc-banner.json +1 -1
  37. package/rules/autoconsent/clustrmaps-com.json +1 -1
  38. package/rules/autoconsent/complianz-notice.json +1 -1
  39. package/rules/autoconsent/cookie-law-info.json +1 -1
  40. package/rules/autoconsent/cookie-notice.json +1 -1
  41. package/rules/autoconsent/cookieinformation.json +1 -1
  42. package/rules/autoconsent/cookieyes.json +1 -1
  43. package/rules/autoconsent/crossfit-com.json +1 -1
  44. package/rules/autoconsent/dailymotion-us.json +1 -1
  45. package/rules/autoconsent/delta-com.json +1 -1
  46. package/rules/autoconsent/dsgvo.json +1 -1
  47. package/rules/autoconsent/eu-cookie-compliance.json +1 -1
  48. package/rules/autoconsent/eu-cookie-law.json +1 -1
  49. package/rules/autoconsent/geeks-for-geeks.json +1 -1
  50. package/rules/autoconsent/generic-cosmetic.json +1 -1
  51. package/rules/autoconsent/hema-com.json +21 -0
  52. package/rules/autoconsent/hl-co-uk.json +1 -1
  53. package/rules/autoconsent/indeed-com.json +1 -1
  54. package/rules/autoconsent/ing-de.json +18 -0
  55. package/rules/autoconsent/itopvpn-com.json +1 -1
  56. package/rules/autoconsent/jquery-cookiebar.json +1 -1
  57. package/rules/autoconsent/macpaw-com.json +1 -1
  58. package/rules/autoconsent/marksandspencer.json +1 -1
  59. package/rules/autoconsent/midway-usa.json +1 -1
  60. package/rules/autoconsent/moove.json +1 -1
  61. package/rules/autoconsent/nba-com.json +1 -1
  62. package/rules/autoconsent/netflix-de.json +1 -1
  63. package/rules/autoconsent/notice-cookie.json +1 -1
  64. package/rules/autoconsent/nrk-no.json +1 -1
  65. package/rules/autoconsent/osano.json +1 -1
  66. package/rules/autoconsent/pinetools-com.json +1 -1
  67. package/rules/autoconsent/pmc-cmp.json +1 -1
  68. package/rules/autoconsent/pornhub.json +1 -1
  69. package/rules/autoconsent/pornpics.json +1 -1
  70. package/rules/autoconsent/primebox.json +1 -1
  71. package/rules/autoconsent/samsung-com.json +1 -1
  72. package/rules/autoconsent/similarweb-com.json +1 -1
  73. package/rules/autoconsent/takealot-com.json +1 -1
  74. package/rules/autoconsent/tealium.json +2 -2
  75. package/rules/autoconsent/testcmp-cosmetic.json +1 -1
  76. package/rules/autoconsent/tidbits-com.json +1 -1
  77. package/rules/autoconsent/tractor-supply.json +1 -1
  78. package/rules/autoconsent/trader-joes-com.json +1 -1
  79. package/rules/autoconsent/true-car.json +1 -1
  80. package/rules/autoconsent/tumblr-com.json +1 -1
  81. package/rules/autoconsent/twitch.json +1 -1
  82. package/rules/autoconsent/uk-cookie-consent.json +1 -1
  83. package/rules/autoconsent/urbanarmorgear-com.json +1 -1
  84. package/rules/autoconsent/whitepages.json +1 -1
  85. package/rules/autoconsent/wpcc.json +1 -1
  86. package/rules/autoconsent/xhamster-us.json +1 -1
  87. package/rules/autoconsent/xnxx-com.json +1 -1
  88. package/rules/autoconsent/youporn.json +1 -1
  89. package/rules/rules.json +127 -184
  90. package/tests/_sample-test.spec.ts +16 -0
  91. package/tests/hema.spec.ts +7 -0
@@ -60,6 +60,7 @@
60
60
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
61
61
  EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
62
62
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
63
+ EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
63
64
  EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
64
65
  if (x.checked)
65
66
  x.click();
@@ -415,14 +415,12 @@
415
415
  return css;
416
416
  }
417
417
  }
418
- function hideElements(styleEl, selectors, method = "display") {
418
+ function hideElements(styleEl, selector, method = "display") {
419
419
  const hidingSnippet = method === "opacity" ? `opacity: 0` : `display: none`;
420
- const rule = `${selectors.join(
421
- ","
422
- )} { ${hidingSnippet} !important; z-index: -1 !important; pointer-events: none !important; } `;
420
+ const rule = `${selector} { ${hidingSnippet} !important; z-index: -1 !important; pointer-events: none !important; } `;
423
421
  if (styleEl instanceof HTMLStyleElement) {
424
422
  styleEl.innerText += rule;
425
- return selectors.length > 0;
423
+ return selector.length > 0;
426
424
  }
427
425
  return false;
428
426
  }
@@ -514,14 +512,14 @@
514
512
  }, ms);
515
513
  });
516
514
  }
517
- function hide(selectors, method) {
515
+ function hide(selector, method) {
518
516
  const styleEl = getStyleElement();
519
- return hideElements(styleEl, selectors, method);
517
+ return hideElements(styleEl, selector, method);
520
518
  }
521
- function prehide(selectors) {
519
+ function prehide(selector) {
522
520
  const styleEl = getStyleElement("autoconsent-prehide");
523
521
  enableLogs && console.log("[prehide]", styleEl, location.href);
524
- return hideElements(styleEl, selectors, "opacity");
522
+ return hideElements(styleEl, selector, "opacity");
525
523
  }
526
524
  function undoPrehide() {
527
525
  const existingElement = getStyleElement("autoconsent-prehide");
@@ -681,6 +679,7 @@
681
679
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
682
680
  EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
683
681
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
682
+ EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
684
683
  EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
685
684
  if (x.checked)
686
685
  x.click();
@@ -1074,7 +1073,7 @@
1074
1073
  }
1075
1074
  hideElements(
1076
1075
  getStyleElement(),
1077
- [".truste_popframe", ".truste_overlay", ".truste_box_overlay", bannerContainer]
1076
+ `.truste_popframe, .truste_overlay, .truste_box_overlay, ${bannerContainer}`
1078
1077
  );
1079
1078
  click(cookieSettingsButton);
1080
1079
  setTimeout(() => {
@@ -1199,9 +1198,7 @@
1199
1198
  return await this.mainWorldEval("EVAL_COOKIEBOT_1");
1200
1199
  }
1201
1200
  async detectPopup() {
1202
- return await waitFor(() => {
1203
- return this.mainWorldEval("EVAL_COOKIEBOT_2");
1204
- }, 10, 500);
1201
+ return this.mainWorldEval("EVAL_COOKIEBOT_2");
1205
1202
  }
1206
1203
  async optOut() {
1207
1204
  await wait(500);
@@ -1425,7 +1422,7 @@
1425
1422
  if (click("#_evidon-decline-button")) {
1426
1423
  return true;
1427
1424
  }
1428
- hideElements(getStyleElement(), ["#evidon-prefdiag-overlay", "#evidon-prefdiag-background"]);
1425
+ hideElements(getStyleElement(), "#evidon-prefdiag-overlay,#evidon-prefdiag-background");
1429
1426
  click("#_evidon-option-button");
1430
1427
  await waitForElement("#evidon-prefdiag-overlay", 5e3);
1431
1428
  click("#evidon-prefdiag-decline");
@@ -2098,7 +2095,7 @@
2098
2095
  this.undoPrehide();
2099
2096
  }
2100
2097
  }, this.config.prehideTimeout || 2e3);
2101
- return prehide(selectors);
2098
+ return prehide(selectors.join(","));
2102
2099
  }
2103
2100
  undoPrehide() {
2104
2101
  this.updateState({ prehideOn: false });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2023.12.28",
4
+ "version": "2024.1.6",
5
5
  "background": {
6
6
  "service_worker": "background.bundle.js"
7
7
  },