@duckduckgo/autoconsent 9.3.0 → 9.5.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 (46) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/addon-firefox/background.bundle.js +2 -2
  3. package/dist/addon-firefox/content.bundle.js +8 -5
  4. package/dist/addon-firefox/rules.json +414 -65
  5. package/dist/addon-mv3/background.bundle.js +2 -2
  6. package/dist/addon-mv3/content.bundle.js +8 -5
  7. package/dist/addon-mv3/rules.json +414 -65
  8. package/dist/autoconsent.cjs.js +8 -5
  9. package/dist/autoconsent.esm.js +8 -5
  10. package/dist/autoconsent.playwright.js +1 -1
  11. package/dist/autoconsent.unit.js +422 -70
  12. package/lib/cmps/base.ts +3 -1
  13. package/lib/cmps/consentmanager.ts +2 -0
  14. package/lib/cmps/sourcepoint-frame.ts +1 -1
  15. package/lib/cmps/uniconsent.ts +2 -2
  16. package/lib/eval-snippets.ts +2 -2
  17. package/package.json +3 -3
  18. package/rules/autoconsent/bahn-de.json +47 -0
  19. package/rules/autoconsent/complianz-categories.json +16 -7
  20. package/rules/autoconsent/complianz-notice.json +9 -3
  21. package/rules/autoconsent/complianz-opt-both.json +14 -0
  22. package/rules/autoconsent/complianz-optin.json +23 -10
  23. package/rules/autoconsent/cookie-law-info.json +4 -1
  24. package/rules/autoconsent/ecosia.json +28 -0
  25. package/rules/autoconsent/eu-cookie-compliance.json +10 -3
  26. package/rules/autoconsent/europa-eu.json +29 -0
  27. package/rules/autoconsent/fides.json +25 -0
  28. package/rules/autoconsent/instagram.json +31 -0
  29. package/rules/autoconsent/ketch.json +23 -20
  30. package/rules/autoconsent/osano.json +3 -4
  31. package/rules/autoconsent/paypal-us.json +3 -3
  32. package/rules/autoconsent/temu.json +28 -0
  33. package/rules/autoconsent/transcend.json +26 -0
  34. package/rules/autoconsent/xvideos.json +28 -0
  35. package/rules/rules.json +414 -65
  36. package/tests/bahn-de.spec.ts +5 -0
  37. package/tests/complianz-opt-both.spec.ts +5 -0
  38. package/tests/ecosia.spec.ts +5 -0
  39. package/tests/eu-cookie-compliance-banner.spec.ts +1 -1
  40. package/tests/europa-eu.spec.ts +6 -0
  41. package/tests/fides.spec.ts +5 -0
  42. package/tests/instagram.spec.ts +5 -0
  43. package/tests/ketch.spec.ts +1 -1
  44. package/tests/temu.spec.ts +5 -0
  45. package/tests/transcend.spec.ts +5 -0
  46. package/tests/xvideos.spec.ts +5 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,42 @@
1
+ # v9.5.0 (Wed Jan 31 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Fix Ketch and eu-cookie-compliance [#351](https://github.com/duckduckgo/autoconsent/pull/351) ([@muodov](https://github.com/muodov))
6
+ - Bump the dev-dependencies group with 7 updates [#360](https://github.com/duckduckgo/autoconsent/pull/360) ([@dependabot[bot]](https://github.com/dependabot[bot]))
7
+ - Add rule for fides CMP [#359](https://github.com/duckduckgo/autoconsent/pull/359) ([@muodov](https://github.com/muodov))
8
+ - More site-specific rules [#358](https://github.com/duckduckgo/autoconsent/pull/358) ([@muodov](https://github.com/muodov))
9
+ - Support another version of uniconsent [#355](https://github.com/duckduckgo/autoconsent/pull/355) ([@muodov](https://github.com/muodov))
10
+ - Improve Consentmanager.net [#353](https://github.com/duckduckgo/autoconsent/pull/353) ([@muodov](https://github.com/muodov))
11
+ - Improve cookie-law-info rule [#352](https://github.com/duckduckgo/autoconsent/pull/352) ([@muodov](https://github.com/muodov))
12
+
13
+ #### 🐛 Bug Fix
14
+
15
+ - fix: paypal-us [#361](https://github.com/duckduckgo/autoconsent/pull/361) ([@seia-soto](https://github.com/seia-soto))
16
+
17
+ #### Authors: 3
18
+
19
+ - [@dependabot[bot]](https://github.com/dependabot[bot])
20
+ - HoJeong Go ([@seia-soto](https://github.com/seia-soto))
21
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
22
+
23
+ ---
24
+
25
+ # v9.4.0 (Fri Jan 26 2024)
26
+
27
+ #### 🚀 Enhancement
28
+
29
+ - Improve Osano rule [#350](https://github.com/duckduckgo/autoconsent/pull/350) ([@muodov](https://github.com/muodov))
30
+ - Increase timeout in the sourcepoint rule [#349](https://github.com/duckduckgo/autoconsent/pull/349) ([@muodov](https://github.com/muodov))
31
+ - Complianz regression fixes [#347](https://github.com/duckduckgo/autoconsent/pull/347) ([@muodov](https://github.com/muodov))
32
+ - Add rule for bahn.de [#348](https://github.com/duckduckgo/autoconsent/pull/348) ([@muodov](https://github.com/muodov))
33
+
34
+ #### Authors: 1
35
+
36
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
37
+
38
+ ---
39
+
1
40
  # v9.3.0 (Fri Jan 26 2024)
2
41
 
3
42
  #### 🚀 Enhancement
@@ -35,6 +35,7 @@
35
35
  EVAL_ALMACMP_0: () => document.cookie.includes('"name":"Google","consent":false'),
36
36
  EVAL_AFFINITY_SERIF_COM_0: () => document.cookie.includes("serif_manage_cookies_viewed") && !document.cookie.includes("serif_allow_analytics"),
37
37
  EVAL_AXEPTIO_0: () => document.cookie.includes("axeptio_authorized_vendors=%2C%2C"),
38
+ EVAL_BAHN_TEST: () => utag.gdpr.getSelectedCategories().length === 1,
38
39
  EVAL_BING_0: () => document.cookie.includes("AL=0") && document.cookie.includes("AD=0") && document.cookie.includes("SM=0"),
39
40
  EVAL_BLOCKSY_0: () => document.cookie.includes("blocksy_cookies_consent_accepted=no"),
40
41
  EVAL_BORLABS_0: () => !JSON.parse(decodeURIComponent(document.cookie.split(";").find((c) => c.indexOf("borlabs-cookie") !== -1).split("=", 2)[1])).consents.statistics,
@@ -45,10 +46,9 @@
45
46
  EVAL_CLINCH_0: () => document.cookie.includes("ctc_rejected=1"),
46
47
  EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
47
48
  EVAL_COMPLIANZ_BANNER_0: () => document.cookie.includes("cmplz_banner-status=dismissed"),
48
- EVAL_COMPLIANZ_CATEGORIES_0: () => !!document.cookie.match(/cmplz_[^=]+=deny/),
49
- EVAL_COMPLIANZ_OPTIN_0: () => !!document.cookie.match(/cookieconsent_preferences_disabled=[^;]+/),
50
49
  EVAL_COOKIE_LAW_INFO_0: () => CLI.disableAllCookies() || CLI.reject_close() || true,
51
50
  EVAL_COOKIE_LAW_INFO_1: () => document.cookie.indexOf("cookielawinfo-checkbox-non-necessary=yes") === -1,
51
+ EVAL_COOKIE_LAW_INFO_DETECT: () => !!window.CLI,
52
52
  EVAL_COOKIE_MANAGER_POPUP_0: () => JSON.parse(document.cookie.split(";").find((c) => c.trim().startsWith("CookieLevel")).split("=")[1]).social === false,
53
53
  EVAL_COOKIEALERT_0: () => document.querySelector("body").removeAttribute("style") || true,
54
54
  EVAL_COOKIEALERT_1: () => document.querySelector("body").removeAttribute("style") || true,
@@ -482,6 +482,7 @@
482
482
  EVAL_ALMACMP_0: () => document.cookie.includes('"name":"Google","consent":false'),
483
483
  EVAL_AFFINITY_SERIF_COM_0: () => document.cookie.includes("serif_manage_cookies_viewed") && !document.cookie.includes("serif_allow_analytics"),
484
484
  EVAL_AXEPTIO_0: () => document.cookie.includes("axeptio_authorized_vendors=%2C%2C"),
485
+ EVAL_BAHN_TEST: () => utag.gdpr.getSelectedCategories().length === 1,
485
486
  EVAL_BING_0: () => document.cookie.includes("AL=0") && document.cookie.includes("AD=0") && document.cookie.includes("SM=0"),
486
487
  EVAL_BLOCKSY_0: () => document.cookie.includes("blocksy_cookies_consent_accepted=no"),
487
488
  EVAL_BORLABS_0: () => !JSON.parse(decodeURIComponent(document.cookie.split(";").find((c) => c.indexOf("borlabs-cookie") !== -1).split("=", 2)[1])).consents.statistics,
@@ -492,10 +493,9 @@
492
493
  EVAL_CLINCH_0: () => document.cookie.includes("ctc_rejected=1"),
493
494
  EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
494
495
  EVAL_COMPLIANZ_BANNER_0: () => document.cookie.includes("cmplz_banner-status=dismissed"),
495
- EVAL_COMPLIANZ_CATEGORIES_0: () => !!document.cookie.match(/cmplz_[^=]+=deny/),
496
- EVAL_COMPLIANZ_OPTIN_0: () => !!document.cookie.match(/cookieconsent_preferences_disabled=[^;]+/),
497
496
  EVAL_COOKIE_LAW_INFO_0: () => CLI.disableAllCookies() || CLI.reject_close() || true,
498
497
  EVAL_COOKIE_LAW_INFO_1: () => document.cookie.indexOf("cookielawinfo-checkbox-non-necessary=yes") === -1,
498
+ EVAL_COOKIE_LAW_INFO_DETECT: () => !!window.CLI,
499
499
  EVAL_COOKIE_MANAGER_POPUP_0: () => JSON.parse(document.cookie.split(";").find((c) => c.trim().startsWith("CookieLevel")).split("=")[1]).social === false,
500
500
  EVAL_COOKIEALERT_0: () => document.querySelector("body").removeAttribute("style") || true,
501
501
  EVAL_COOKIEALERT_1: () => document.querySelector("body").removeAttribute("style") || true,
@@ -802,6 +802,8 @@
802
802
  results.push(this._runRulesSequentially(rule.then));
803
803
  } else if (rule.else) {
804
804
  results.push(this._runRulesSequentially(rule.else));
805
+ } else {
806
+ results.push(true);
805
807
  }
806
808
  }
807
809
  if (rule.any) {
@@ -1284,7 +1286,7 @@
1284
1286
  this.waitForElement(".pm-features", 2e3).then((success) => success ? 2 : -1)
1285
1287
  ]);
1286
1288
  if (path === 0) {
1287
- await this.wait(1e3);
1289
+ await this.wait(1500);
1288
1290
  return this.click(rejectSelector1);
1289
1291
  } else if (path === 1) {
1290
1292
  this.click(rejectSelector2);
@@ -1349,6 +1351,7 @@
1349
1351
  await this.waitForElement(".cmptblbox", 2e3);
1350
1352
  this.click(".cmptdchoice > a[aria-checked=true]", true);
1351
1353
  this.click(".cmpboxbtnyescustomchoices");
1354
+ this.hide("#cmpwrapper,#cmpbox", "display");
1352
1355
  return true;
1353
1356
  }
1354
1357
  async optIn() {
@@ -1531,10 +1534,10 @@
1531
1534
  return false;
1532
1535
  }
1533
1536
  async detectCmp() {
1534
- return this.elementExists(".unic .unic-box,.unic .unic-bar");
1537
+ return this.elementExists(".unic .unic-box,.unic .unic-bar,.unic .unic-modal");
1535
1538
  }
1536
1539
  async detectPopup() {
1537
- return this.elementVisible(".unic .unic-box,.unic .unic-bar", "any");
1540
+ return this.elementVisible(".unic .unic-box,.unic .unic-bar,.unic .unic-modal", "any");
1538
1541
  }
1539
1542
  async optOut() {
1540
1543
  await this.waitForElement(".unic button", 1e3);