@duckduckgo/autoconsent 9.5.0 → 9.7.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 (74) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/addon-firefox/background.bundle.js +7 -0
  3. package/dist/addon-firefox/content.bundle.js +20 -6
  4. package/dist/addon-firefox/manifest.json +1 -1
  5. package/dist/addon-firefox/rules.json +948 -13
  6. package/dist/addon-mv3/background.bundle.js +7 -0
  7. package/dist/addon-mv3/content.bundle.js +20 -6
  8. package/dist/addon-mv3/manifest.json +1 -1
  9. package/dist/addon-mv3/rules.json +948 -13
  10. package/dist/autoconsent.cjs.js +20 -6
  11. package/dist/autoconsent.esm.js +20 -6
  12. package/dist/autoconsent.playwright.js +1 -1
  13. package/dist/autoconsent.unit.js +966 -17
  14. package/lib/eval-snippets.ts +7 -0
  15. package/lib/web.ts +13 -10
  16. package/package.json +1 -1
  17. package/rules/autoconsent/abconcerts.be.json +39 -0
  18. package/rules/autoconsent/aliexpress.json +39 -0
  19. package/rules/autoconsent/arbeitsagentur.json +36 -0
  20. package/rules/autoconsent/asus.json +43 -0
  21. package/rules/autoconsent/cookieacceptbar.json +26 -0
  22. package/rules/autoconsent/cookieconsent2.json +32 -0
  23. package/rules/autoconsent/cookieconsent3.json +29 -0
  24. package/rules/autoconsent/dndbeyond.json +31 -0
  25. package/rules/autoconsent/hashicorp.json +31 -0
  26. package/rules/autoconsent/hu-manity.json +28 -0
  27. package/rules/autoconsent/jdsports.json +39 -0
  28. package/rules/autoconsent/lineagrafica.json +26 -0
  29. package/rules/autoconsent/livejasmin.json +39 -0
  30. package/rules/autoconsent/om.json +40 -0
  31. package/rules/autoconsent/openli.json +26 -0
  32. package/rules/autoconsent/ourworldindata.json +28 -0
  33. package/rules/autoconsent/pabcogypsum.json +25 -0
  34. package/rules/autoconsent/productz.com.json +28 -0
  35. package/rules/autoconsent/reddit.json +19 -5
  36. package/rules/autoconsent/setapp.com.json +29 -0
  37. package/rules/autoconsent/svt.se.json +31 -0
  38. package/rules/autoconsent/taunton.json +36 -0
  39. package/rules/autoconsent/tealium.json +4 -4
  40. package/rules/autoconsent/termsfeed.json +26 -0
  41. package/rules/autoconsent/termsfeed3.json +27 -0
  42. package/rules/autoconsent/twitch-mobile.json +29 -0
  43. package/rules/autoconsent/webflow.json +34 -0
  44. package/rules/autoconsent/wolframalpha.json +29 -0
  45. package/rules/autoconsent/xe.com.json +39 -0
  46. package/rules/create-rule.mjs +2 -2
  47. package/rules/rules.json +948 -13
  48. package/tests/abconcerts.be.spec.ts +7 -0
  49. package/tests/aliexpress.spec.ts +6 -0
  50. package/tests/arbeitsagentur.spec.ts +5 -0
  51. package/tests/asus.spec.ts +6 -0
  52. package/tests/cookieacceptbar.spec.ts +6 -0
  53. package/tests/cookieconsent2.spec.ts +7 -0
  54. package/tests/cookieconsent3.spec.ts +5 -0
  55. package/tests/dndbeyond.spec.ts +5 -0
  56. package/tests/hashicorp.spec.ts +5 -0
  57. package/tests/hu-manity.spec.ts +7 -0
  58. package/tests/jdsports.spec.ts +5 -0
  59. package/tests/lineagrafica.spec.ts +5 -0
  60. package/tests/livejasmin.spec.ts +5 -0
  61. package/tests/om.spec.ts +9 -0
  62. package/tests/openli.spec.ts +6 -0
  63. package/tests/ourworldindata.spec.ts +5 -0
  64. package/tests/pabcogypsum.spec.ts +5 -0
  65. package/tests/productz.com.spec.ts +5 -0
  66. package/tests/setapp.com.spec.ts +5 -0
  67. package/tests/svt.se.spec.ts +5 -0
  68. package/tests/taunton.spec.ts +11 -0
  69. package/tests/termsfeed.spec.ts +6 -0
  70. package/tests/termsfeed3.spec.ts +7 -0
  71. package/tests/twitch-mobile.spec.ts +5 -0
  72. package/tests/webflow.spec.ts +7 -0
  73. package/tests/wolframalpha.spec.ts +5 -0
  74. package/tests/xe.com.spec.ts +5 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,34 @@
1
+ # v9.7.0 (Fri Feb 02 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - More rules for common CMPs [#367](https://github.com/duckduckgo/autoconsent/pull/367) ([@muodov](https://github.com/muodov))
6
+ - More site-specific pop-ups [#366](https://github.com/duckduckgo/autoconsent/pull/366) ([@muodov](https://github.com/muodov))
7
+
8
+ #### Authors: 1
9
+
10
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
11
+
12
+ ---
13
+
14
+ # v9.6.0 (Wed Jan 31 2024)
15
+
16
+ #### 🚀 Enhancement
17
+
18
+ - Add rule for webflow [#364](https://github.com/duckduckgo/autoconsent/pull/364) ([@muodov](https://github.com/muodov))
19
+ - Handle Tealium implicit modal [#363](https://github.com/duckduckgo/autoconsent/pull/363) ([@muodov](https://github.com/muodov))
20
+ - Fix reddit rule [#362](https://github.com/duckduckgo/autoconsent/pull/362) ([@muodov](https://github.com/muodov))
21
+
22
+ #### 🐛 Bug Fix
23
+
24
+ - regression fix: Do not run opt-out unless a pop-up is actually shown [#365](https://github.com/duckduckgo/autoconsent/pull/365) ([@muodov](https://github.com/muodov))
25
+
26
+ #### Authors: 1
27
+
28
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
29
+
30
+ ---
31
+
1
32
  # v9.5.0 (Wed Jan 31 2024)
2
33
 
3
34
  #### 🚀 Enhancement
@@ -34,6 +34,7 @@
34
34
  EVAL_ADROLL_0: () => !document.cookie.includes("__adroll_fpc"),
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
+ EVAL_ARBEITSAGENTUR_TEST: () => document.cookie.includes("cookie_consent=denied"),
37
38
  EVAL_AXEPTIO_0: () => document.cookie.includes("axeptio_authorized_vendors=%2C%2C"),
38
39
  EVAL_BAHN_TEST: () => utag.gdpr.getSelectedCategories().length === 1,
39
40
  EVAL_BING_0: () => document.cookie.includes("AL=0") && document.cookie.includes("AD=0") && document.cookie.includes("SM=0"),
@@ -44,6 +45,8 @@
44
45
  EVAL_CC_BANNER2_0: () => !!document.cookie.match(/sncc=[^;]+D%3Dtrue/),
45
46
  EVAL_CLICKIO_0: () => document.cookie.includes("__lxG__consent__v2_daisybit="),
46
47
  EVAL_CLINCH_0: () => document.cookie.includes("ctc_rejected=1"),
48
+ EVAL_COOKIECONSENT2_TEST: () => document.cookie.includes("cc_cookie="),
49
+ EVAL_COOKIECONSENT3_TEST: () => document.cookie.includes("cc_cookie="),
47
50
  EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
48
51
  EVAL_COMPLIANZ_BANNER_0: () => document.cookie.includes("cmplz_banner-status=dismissed"),
49
52
  EVAL_COOKIE_LAW_INFO_0: () => CLI.disableAllCookies() || CLI.reject_close() || true,
@@ -60,6 +63,7 @@
60
63
  EVAL_COOKIEINFORMATION_2: () => document.cookie.includes("CookieInformationConsent="),
61
64
  EVAL_COOKIEYES_0: () => document.cookie.includes("advertisement:no"),
62
65
  EVAL_DAILYMOTION_0: () => !!document.cookie.match("dm-euconsent-v2"),
66
+ EVAL_DNDBEYOND_TEST: () => document.cookie.includes("cookie-consent=denied"),
63
67
  EVAL_DSGVO_0: () => !document.cookie.includes("sp_dsgvo_cookie_settings"),
64
68
  EVAL_DUNELM_0: () => document.cookie.includes("cc_functional=0") && document.cookie.includes("cc_targeting=0"),
65
69
  EVAL_ETSY_0: () => document.querySelectorAll(".gdpr-overlay-body input").forEach((toggle) => {
@@ -97,10 +101,12 @@
97
101
  EVAL_SIRDATA_0: () => document.cookie.includes("euconsent-v2"),
98
102
  EVAL_SNIGEL_0: () => !!document.cookie.match("snconsent"),
99
103
  EVAL_STEAMPOWERED_0: () => JSON.parse(decodeURIComponent(document.cookie.split(";").find((s) => s.trim().startsWith("cookieSettings")).split("=")[1])).preference_state === 2,
104
+ EVAL_SVT_TEST: () => document.cookie.includes('cookie-consent-1={"optedIn":true,"functionality":false,"statistics":false}'),
100
105
  EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
101
106
  EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
102
107
  EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
103
108
  EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
109
+ EVAL_TAUNTON_TEST: () => document.cookie.includes("taunton_user_consent_submitted=true"),
104
110
  EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
105
111
  EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
106
112
  EVAL_TEALIUM_DONOTSELL: () => utag.gdpr.dns?.setDnsState(false) || true,
@@ -125,6 +131,7 @@
125
131
  EVAL_WAITROSE_0: () => Array.from(document.querySelectorAll("label[id$=cookies-deny-label]")).forEach((e) => e.click()) || true,
126
132
  EVAL_WAITROSE_1: () => document.cookie.includes("wtr_cookies_advertising=0") && document.cookie.includes("wtr_cookies_analytics=0"),
127
133
  EVAL_WP_COOKIE_NOTICE_0: () => document.cookie.includes("wpl_viewed_cookie=no"),
134
+ EVAL_XE_TEST: () => document.cookie.includes("xeConsentState={%22performance%22:false%2C%22marketing%22:false%2C%22compliance%22:false}"),
128
135
  EVAL_XING_0: () => document.cookie.includes("userConsent=%7B%22marketing%22%3Afalse"),
129
136
  EVAL_YOUTUBE_DESKTOP_0: () => !!document.cookie.match(/SOCS=CAE/),
130
137
  EVAL_YOUTUBE_MOBILE_0: () => !!document.cookie.match(/SOCS=CAE/)
@@ -481,6 +481,7 @@
481
481
  EVAL_ADROLL_0: () => !document.cookie.includes("__adroll_fpc"),
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
+ EVAL_ARBEITSAGENTUR_TEST: () => document.cookie.includes("cookie_consent=denied"),
484
485
  EVAL_AXEPTIO_0: () => document.cookie.includes("axeptio_authorized_vendors=%2C%2C"),
485
486
  EVAL_BAHN_TEST: () => utag.gdpr.getSelectedCategories().length === 1,
486
487
  EVAL_BING_0: () => document.cookie.includes("AL=0") && document.cookie.includes("AD=0") && document.cookie.includes("SM=0"),
@@ -491,6 +492,8 @@
491
492
  EVAL_CC_BANNER2_0: () => !!document.cookie.match(/sncc=[^;]+D%3Dtrue/),
492
493
  EVAL_CLICKIO_0: () => document.cookie.includes("__lxG__consent__v2_daisybit="),
493
494
  EVAL_CLINCH_0: () => document.cookie.includes("ctc_rejected=1"),
495
+ EVAL_COOKIECONSENT2_TEST: () => document.cookie.includes("cc_cookie="),
496
+ EVAL_COOKIECONSENT3_TEST: () => document.cookie.includes("cc_cookie="),
494
497
  EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
495
498
  EVAL_COMPLIANZ_BANNER_0: () => document.cookie.includes("cmplz_banner-status=dismissed"),
496
499
  EVAL_COOKIE_LAW_INFO_0: () => CLI.disableAllCookies() || CLI.reject_close() || true,
@@ -507,6 +510,7 @@
507
510
  EVAL_COOKIEINFORMATION_2: () => document.cookie.includes("CookieInformationConsent="),
508
511
  EVAL_COOKIEYES_0: () => document.cookie.includes("advertisement:no"),
509
512
  EVAL_DAILYMOTION_0: () => !!document.cookie.match("dm-euconsent-v2"),
513
+ EVAL_DNDBEYOND_TEST: () => document.cookie.includes("cookie-consent=denied"),
510
514
  EVAL_DSGVO_0: () => !document.cookie.includes("sp_dsgvo_cookie_settings"),
511
515
  EVAL_DUNELM_0: () => document.cookie.includes("cc_functional=0") && document.cookie.includes("cc_targeting=0"),
512
516
  EVAL_ETSY_0: () => document.querySelectorAll(".gdpr-overlay-body input").forEach((toggle) => {
@@ -544,10 +548,12 @@
544
548
  EVAL_SIRDATA_0: () => document.cookie.includes("euconsent-v2"),
545
549
  EVAL_SNIGEL_0: () => !!document.cookie.match("snconsent"),
546
550
  EVAL_STEAMPOWERED_0: () => JSON.parse(decodeURIComponent(document.cookie.split(";").find((s) => s.trim().startsWith("cookieSettings")).split("=")[1])).preference_state === 2,
551
+ EVAL_SVT_TEST: () => document.cookie.includes('cookie-consent-1={"optedIn":true,"functionality":false,"statistics":false}'),
547
552
  EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
548
553
  EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
549
554
  EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
550
555
  EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
556
+ EVAL_TAUNTON_TEST: () => document.cookie.includes("taunton_user_consent_submitted=true"),
551
557
  EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
552
558
  EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
553
559
  EVAL_TEALIUM_DONOTSELL: () => utag.gdpr.dns?.setDnsState(false) || true,
@@ -572,6 +578,7 @@
572
578
  EVAL_WAITROSE_0: () => Array.from(document.querySelectorAll("label[id$=cookies-deny-label]")).forEach((e) => e.click()) || true,
573
579
  EVAL_WAITROSE_1: () => document.cookie.includes("wtr_cookies_advertising=0") && document.cookie.includes("wtr_cookies_analytics=0"),
574
580
  EVAL_WP_COOKIE_NOTICE_0: () => document.cookie.includes("wpl_viewed_cookie=no"),
581
+ EVAL_XE_TEST: () => document.cookie.includes("xeConsentState={%22performance%22:false%2C%22marketing%22:false%2C%22compliance%22:false}"),
575
582
  EVAL_XING_0: () => document.cookie.includes("userConsent=%7B%22marketing%22%3Afalse"),
576
583
  EVAL_YOUTUBE_DESKTOP_0: () => !!document.cookie.match(/SOCS=CAE/),
577
584
  EVAL_YOUTUBE_MOBILE_0: () => !!document.cookie.match(/SOCS=CAE/)
@@ -2065,8 +2072,14 @@
2065
2072
  }
2066
2073
  return foundCMPs;
2067
2074
  }
2075
+ /**
2076
+ * Detect if a CMP has a popup open. Fullfils with the CMP if a popup is open, otherwise rejects.
2077
+ */
2068
2078
  async detectPopup(cmp) {
2069
- const isOpen = await this.waitForPopup(cmp);
2079
+ const isOpen = await this.waitForPopup(cmp).catch((error) => {
2080
+ this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
2081
+ return false;
2082
+ });
2070
2083
  if (isOpen) {
2071
2084
  this.updateState({ detectedPopups: this.state.detectedPopups.concat([cmp.name]) });
2072
2085
  this.sendContentMessage({
@@ -2074,15 +2087,16 @@
2074
2087
  cmp: cmp.name,
2075
2088
  url: location.href
2076
2089
  });
2090
+ return cmp;
2077
2091
  }
2078
- return cmp;
2092
+ throw new Error("Popup is not shown");
2079
2093
  }
2094
+ /**
2095
+ * Detect if any of the CMPs has a popup open. Returns a list of CMPs with open popups.
2096
+ */
2080
2097
  async detectPopups(cmps, onFirstPopupAppears) {
2081
2098
  const tasks = cmps.map(
2082
- (cmp) => this.detectPopup(cmp).catch((error) => {
2083
- this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
2084
- throw error;
2085
- })
2099
+ (cmp) => this.detectPopup(cmp)
2086
2100
  );
2087
2101
  await Promise.any(tasks).then((cmp) => {
2088
2102
  onFirstPopupAppears(cmp);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 2,
3
3
  "name": "Autoconsent",
4
- "version": "2024.1.26",
4
+ "version": "2024.1.31",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"