@duckduckgo/autoconsent 10.3.2 → 10.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ # v10.5.0 (Tue Apr 02 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Fix Moove on mitglieder.franzspitzer.de [#409](https://github.com/duckduckgo/autoconsent/pull/409) ([@muodov](https://github.com/muodov))
6
+ - Add .cc-type-out-out variant of Complianz popup [#402](https://github.com/duckduckgo/autoconsent/pull/402) ([@sammacbeth](https://github.com/sammacbeth))
7
+ - Rules for two Ensighten banner variants [#403](https://github.com/duckduckgo/autoconsent/pull/403) ([@sammacbeth](https://github.com/sammacbeth))
8
+
9
+ #### Authors: 2
10
+
11
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
12
+ - Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
13
+
14
+ ---
15
+
16
+ # v10.4.0 (Tue Mar 26 2024)
17
+
18
+ #### 🚀 Enhancement
19
+
20
+ - Check runcontext for prehide selectors. [#400](https://github.com/duckduckgo/autoconsent/pull/400) ([@sammacbeth](https://github.com/sammacbeth))
21
+ - Fix rules for tumblr.com, onlyfans, canva.com, cookie-script [#395](https://github.com/duckduckgo/autoconsent/pull/395) ([@muodov](https://github.com/muodov))
22
+
23
+ #### Authors: 2
24
+
25
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
26
+ - Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
27
+
28
+ ---
29
+
1
30
  # v10.3.2 (Wed Mar 20 2024)
2
31
 
3
32
  #### 🐛 Bug Fix
@@ -88,8 +88,8 @@
88
88
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
89
89
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
90
90
  EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
91
- if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
92
- i.checked = false;
91
+ if (!i.disabled)
92
+ i.checked = i.name === "moove_gdpr_strict_cookies" || i.id === "moove_gdpr_strict_cookies";
93
93
  }) || true,
94
94
  EVAL_ONENINETWO_0: () => document.cookie.includes("CC_ADVERTISING=NO") && document.cookie.includes("CC_ANALYTICS=NO"),
95
95
  EVAL_OPERA_0: () => document.cookie.includes("cookie_consent_essential=true") && !document.cookie.includes("cookie_consent_marketing=true"),
@@ -535,8 +535,8 @@
535
535
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
536
536
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
537
537
  EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
538
- if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
539
- i.checked = false;
538
+ if (!i.disabled)
539
+ i.checked = i.name === "moove_gdpr_strict_cookies" || i.id === "moove_gdpr_strict_cookies";
540
540
  }) || true,
541
541
  EVAL_ONENINETWO_0: () => document.cookie.includes("CC_ADVERTISING=NO") && document.cookie.includes("CC_ANALYTICS=NO"),
542
542
  EVAL_OPERA_0: () => document.cookie.includes("cookie_consent_essential=true") && !document.cookie.includes("cookie_consent_marketing=true"),
@@ -1212,7 +1212,7 @@
1212
1212
  this.ccpaNotice = false;
1213
1213
  this.ccpaPopup = false;
1214
1214
  this.runContext = {
1215
- main: false,
1215
+ main: true,
1216
1216
  frame: true
1217
1217
  };
1218
1218
  }
@@ -1752,6 +1752,63 @@
1752
1752
  }
1753
1753
  };
1754
1754
 
1755
+ // lib/cmps/tumblr-com.ts
1756
+ var Tumblr = class extends AutoConsentCMPBase {
1757
+ constructor() {
1758
+ super(...arguments);
1759
+ this.name = "tumblr-com";
1760
+ this.runContext = {
1761
+ "urlPattern": "^https://(www\\.)?tumblr\\.com/"
1762
+ };
1763
+ }
1764
+ get hasSelfTest() {
1765
+ return false;
1766
+ }
1767
+ get isIntermediate() {
1768
+ return false;
1769
+ }
1770
+ get isCosmetic() {
1771
+ return false;
1772
+ }
1773
+ get prehideSelectors() {
1774
+ return ["#cmp-app-container"];
1775
+ }
1776
+ async detectCmp() {
1777
+ return this.elementExists("#cmp-app-container");
1778
+ }
1779
+ async detectPopup() {
1780
+ return this.elementVisible("#cmp-app-container", "any");
1781
+ }
1782
+ async optOut() {
1783
+ let iframe = document.querySelector("#cmp-app-container iframe");
1784
+ let settingsButton = iframe.contentDocument?.querySelector(".cmp-components-button.is-secondary");
1785
+ if (!settingsButton) {
1786
+ return false;
1787
+ }
1788
+ settingsButton.click();
1789
+ await waitFor(() => {
1790
+ const iframe2 = document.querySelector("#cmp-app-container iframe");
1791
+ return !!iframe2.contentDocument?.querySelector(".cmp__dialog input");
1792
+ }, 5, 500);
1793
+ iframe = document.querySelector("#cmp-app-container iframe");
1794
+ settingsButton = iframe.contentDocument?.querySelector(".cmp-components-button.is-secondary");
1795
+ if (!settingsButton) {
1796
+ return false;
1797
+ }
1798
+ settingsButton.click();
1799
+ return true;
1800
+ }
1801
+ async optIn() {
1802
+ const iframe = document.querySelector("#cmp-app-container iframe");
1803
+ const acceptButton = iframe.contentDocument.querySelector(".cmp-components-button.is-primary");
1804
+ if (acceptButton) {
1805
+ acceptButton.click();
1806
+ return true;
1807
+ }
1808
+ return false;
1809
+ }
1810
+ };
1811
+
1755
1812
  // lib/cmps/all.ts
1756
1813
  var dynamicCMPs = [
1757
1814
  TrustArcTop,
@@ -1765,7 +1822,8 @@
1765
1822
  Uniconsent,
1766
1823
  Conversant,
1767
1824
  Tiktok,
1768
- Airbnb
1825
+ Airbnb,
1826
+ Tumblr
1769
1827
  ];
1770
1828
 
1771
1829
  // lib/dom-actions.ts
@@ -2240,12 +2298,7 @@
2240
2298
  const globalHidden = [
2241
2299
  "#didomi-popup,.didomi-popup-container,.didomi-popup-notice,.didomi-consent-popup-preferences,#didomi-notice,.didomi-popup-backdrop,.didomi-screen-medium"
2242
2300
  ];
2243
- const selectors = this.rules.reduce((selectorList, rule) => {
2244
- if (rule.prehideSelectors) {
2245
- return [...selectorList, ...rule.prehideSelectors];
2246
- }
2247
- return selectorList;
2248
- }, globalHidden);
2301
+ const selectors = this.rules.filter((rule) => rule.prehideSelectors && rule.checkRunContext()).reduce((selectorList, rule) => [...selectorList, ...rule.prehideSelectors], globalHidden);
2249
2302
  this.updateState({ prehideOn: true });
2250
2303
  setTimeout(() => {
2251
2304
  if (this.config.enablePrehide && this.state.prehideOn && !["runningOptOut", "runningOptIn"].includes(this.state.lifecycle)) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 2,
3
3
  "name": "Autoconsent",
4
- "version": "2024.3.15",
4
+ "version": "2024.3.26",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"
@@ -969,10 +969,13 @@
969
969
  "click": "div[role=\"dialog\"] button:nth-child(2)"
970
970
  },
971
971
  {
972
- "waitFor": "div[role=\"dialog\"] a[data-anchor-id=\"privacy-policy\"]"
972
+ "waitFor": "div[role=\"dialog\"] a[data-anchor-id=\"cookie-policy\"]"
973
973
  },
974
974
  {
975
- "click": "div[role=\"dialog\"] button:nth-child(2)"
975
+ "waitFor": "div[role=\"dialog\"] button[role=switch]"
976
+ },
977
+ {
978
+ "click": "div[role=\"dialog\"] button:nth-child(2):not([role])"
976
979
  },
977
980
  {
978
981
  "click": "div[role=\"dialog\"] div:last-child button:only-child"
@@ -1527,6 +1530,53 @@
1527
1530
  }
1528
1531
  ]
1529
1532
  },
1533
+ {
1534
+ "name": "Complianz opt-out",
1535
+ "prehideSelectors": [
1536
+ "[aria-describedby=\"cookieconsent:desc\"].cc-type-opt-out"
1537
+ ],
1538
+ "detectCmp": [
1539
+ {
1540
+ "exists": "[aria-describedby=\"cookieconsent:desc\"].cc-type-opt-out"
1541
+ }
1542
+ ],
1543
+ "detectPopup": [
1544
+ {
1545
+ "visible": "[aria-describedby=\"cookieconsent:desc\"].cc-type-opt-out"
1546
+ }
1547
+ ],
1548
+ "optIn": [
1549
+ {
1550
+ "click": ".cc-accept-all",
1551
+ "optional": true
1552
+ },
1553
+ {
1554
+ "click": ".cc-allow",
1555
+ "optional": true
1556
+ },
1557
+ {
1558
+ "click": ".cc-dismiss",
1559
+ "optional": true
1560
+ }
1561
+ ],
1562
+ "optOut": [
1563
+ {
1564
+ "if": {
1565
+ "exists": ".cc-deny"
1566
+ },
1567
+ "then": [
1568
+ {
1569
+ "click": ".cc-deny"
1570
+ }
1571
+ ],
1572
+ "else": [
1573
+ {
1574
+ "hide": "[aria-describedby=\"cookieconsent:desc\"]"
1575
+ }
1576
+ ]
1577
+ }
1578
+ ]
1579
+ },
1530
1580
  {
1531
1581
  "name": "Complianz optin",
1532
1582
  "prehideSelectors": [
@@ -1740,7 +1790,28 @@
1740
1790
  ],
1741
1791
  "optOut": [
1742
1792
  {
1743
- "click": "#cookiescript_reject"
1793
+ "if": {
1794
+ "exists": "#cookiescript_reject"
1795
+ },
1796
+ "then": [
1797
+ {
1798
+ "wait": 100
1799
+ },
1800
+ {
1801
+ "click": "#cookiescript_reject"
1802
+ }
1803
+ ],
1804
+ "else": [
1805
+ {
1806
+ "click": "#cookiescript_manage"
1807
+ },
1808
+ {
1809
+ "waitForVisible": ".cookiescript_fsd_main"
1810
+ },
1811
+ {
1812
+ "waitForThenClick": "#cookiescript_reject"
1813
+ }
1814
+ ]
1744
1815
  }
1745
1816
  ],
1746
1817
  "optIn": [
@@ -2110,7 +2181,7 @@
2110
2181
  {
2111
2182
  "name": "csu-landtag-de",
2112
2183
  "runContext": {
2113
- "urlPattern": "^https://(www|)?\\.csu-landtag\\.de"
2184
+ "urlPattern": "^https://(www\\.|)?csu-landtag\\.de"
2114
2185
  },
2115
2186
  "prehideSelectors": [
2116
2187
  "#cookie-disclaimer"
@@ -2481,6 +2552,62 @@
2481
2552
  }
2482
2553
  ]
2483
2554
  },
2555
+ {
2556
+ "name": "Ensighten ensModal",
2557
+ "prehideSelectors": [
2558
+ ".ensModal"
2559
+ ],
2560
+ "detectCmp": [
2561
+ {
2562
+ "exists": ".ensModal"
2563
+ }
2564
+ ],
2565
+ "detectPopup": [
2566
+ {
2567
+ "visible": ".ensModal"
2568
+ }
2569
+ ],
2570
+ "optIn": [
2571
+ {
2572
+ "waitForThenClick": "#modalAcceptButton"
2573
+ }
2574
+ ],
2575
+ "optOut": [
2576
+ {
2577
+ "waitForThenClick": ".ensCheckbox:checked",
2578
+ "all": true
2579
+ },
2580
+ {
2581
+ "waitForThenClick": "#ensSave"
2582
+ }
2583
+ ]
2584
+ },
2585
+ {
2586
+ "name": "Ensighten ensNotifyBanner",
2587
+ "prehideSelectors": [
2588
+ "#ensNotifyBanner"
2589
+ ],
2590
+ "detectCmp": [
2591
+ {
2592
+ "exists": "#ensNotifyBanner"
2593
+ }
2594
+ ],
2595
+ "detectPopup": [
2596
+ {
2597
+ "visible": "#ensNotifyBanner"
2598
+ }
2599
+ ],
2600
+ "optIn": [
2601
+ {
2602
+ "waitForThenClick": "#ensCloseBanner"
2603
+ }
2604
+ ],
2605
+ "optOut": [
2606
+ {
2607
+ "waitForThenClick": "#ensRejectAll,#rejectAll,#ensRejectBanner"
2608
+ }
2609
+ ]
2610
+ },
2484
2611
  {
2485
2612
  "name": "etsy",
2486
2613
  "prehideSelectors": [
@@ -4057,7 +4184,7 @@
4057
4184
  ],
4058
4185
  "detectPopup": [
4059
4186
  {
4060
- "visible": "#moove_gdpr_cookie_info_bar"
4187
+ "visible": "#moove_gdpr_cookie_info_bar:not(.moove-gdpr-info-bar-hidden)"
4061
4188
  }
4062
4189
  ],
4063
4190
  "optIn": [
@@ -4337,6 +4464,9 @@
4337
4464
  },
4338
4465
  {
4339
4466
  "name": "onlyFans.com",
4467
+ "runContext": {
4468
+ "urlPattern": "^https://onlyfans\\.com/"
4469
+ },
4340
4470
  "prehideSelectors": [
4341
4471
  "div.b-cookies-informer"
4342
4472
  ],
@@ -4360,10 +4490,18 @@
4360
4490
  "click": "div.b-cookies-informer__nav > button:nth-child(1)"
4361
4491
  },
4362
4492
  {
4363
- "click": "div.b-cookies-informer__switchers > div:nth-child(2) > div[at-attr=\"checkbox\"] > span.b-input-radio__container > input[type=\"checkbox\"]"
4364
- },
4365
- {
4366
- "click": "div.b-cookies-informer__nav > button"
4493
+ "if": {
4494
+ "exists": "div.b-cookies-informer__switchers"
4495
+ },
4496
+ "then": [
4497
+ {
4498
+ "click": "div.b-cookies-informer__switchers input:not([disabled])",
4499
+ "all": true
4500
+ },
4501
+ {
4502
+ "click": "div.b-cookies-informer__nav > button"
4503
+ }
4504
+ ]
4367
4505
  }
4368
4506
  ]
4369
4507
  },
@@ -6106,33 +6244,6 @@
6106
6244
  }
6107
6245
  ]
6108
6246
  },
6109
- {
6110
- "name": "tumblr-com",
6111
- "cosmetic": true,
6112
- "prehideSelectors": [
6113
- "#cmp-app-container"
6114
- ],
6115
- "detectCmp": [
6116
- {
6117
- "exists": "#cmp-app-container"
6118
- }
6119
- ],
6120
- "detectPopup": [
6121
- {
6122
- "visible": "#cmp-app-container"
6123
- }
6124
- ],
6125
- "optIn": [
6126
- {
6127
- "click": "#tumblr #cmp-app-container div.components-modal__frame > iframe > html body > div > div > div.cmp__dialog-footer > div > button.components-button.white-space-normal.is-primary"
6128
- }
6129
- ],
6130
- "optOut": [
6131
- {
6132
- "hide": "#cmp-app-container"
6133
- }
6134
- ]
6135
- },
6136
6247
  {
6137
6248
  "name": "twitch-mobile",
6138
6249
  "vendorUrl": "https://m.twitch.tv/",
@@ -88,8 +88,8 @@
88
88
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
89
89
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
90
90
  EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
91
- if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
92
- i.checked = false;
91
+ if (!i.disabled)
92
+ i.checked = i.name === "moove_gdpr_strict_cookies" || i.id === "moove_gdpr_strict_cookies";
93
93
  }) || true,
94
94
  EVAL_ONENINETWO_0: () => document.cookie.includes("CC_ADVERTISING=NO") && document.cookie.includes("CC_ANALYTICS=NO"),
95
95
  EVAL_OPERA_0: () => document.cookie.includes("cookie_consent_essential=true") && !document.cookie.includes("cookie_consent_marketing=true"),
@@ -535,8 +535,8 @@
535
535
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
536
536
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
537
537
  EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
538
- if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
539
- i.checked = false;
538
+ if (!i.disabled)
539
+ i.checked = i.name === "moove_gdpr_strict_cookies" || i.id === "moove_gdpr_strict_cookies";
540
540
  }) || true,
541
541
  EVAL_ONENINETWO_0: () => document.cookie.includes("CC_ADVERTISING=NO") && document.cookie.includes("CC_ANALYTICS=NO"),
542
542
  EVAL_OPERA_0: () => document.cookie.includes("cookie_consent_essential=true") && !document.cookie.includes("cookie_consent_marketing=true"),
@@ -1212,7 +1212,7 @@
1212
1212
  this.ccpaNotice = false;
1213
1213
  this.ccpaPopup = false;
1214
1214
  this.runContext = {
1215
- main: false,
1215
+ main: true,
1216
1216
  frame: true
1217
1217
  };
1218
1218
  }
@@ -1752,6 +1752,63 @@
1752
1752
  }
1753
1753
  };
1754
1754
 
1755
+ // lib/cmps/tumblr-com.ts
1756
+ var Tumblr = class extends AutoConsentCMPBase {
1757
+ constructor() {
1758
+ super(...arguments);
1759
+ this.name = "tumblr-com";
1760
+ this.runContext = {
1761
+ "urlPattern": "^https://(www\\.)?tumblr\\.com/"
1762
+ };
1763
+ }
1764
+ get hasSelfTest() {
1765
+ return false;
1766
+ }
1767
+ get isIntermediate() {
1768
+ return false;
1769
+ }
1770
+ get isCosmetic() {
1771
+ return false;
1772
+ }
1773
+ get prehideSelectors() {
1774
+ return ["#cmp-app-container"];
1775
+ }
1776
+ async detectCmp() {
1777
+ return this.elementExists("#cmp-app-container");
1778
+ }
1779
+ async detectPopup() {
1780
+ return this.elementVisible("#cmp-app-container", "any");
1781
+ }
1782
+ async optOut() {
1783
+ let iframe = document.querySelector("#cmp-app-container iframe");
1784
+ let settingsButton = iframe.contentDocument?.querySelector(".cmp-components-button.is-secondary");
1785
+ if (!settingsButton) {
1786
+ return false;
1787
+ }
1788
+ settingsButton.click();
1789
+ await waitFor(() => {
1790
+ const iframe2 = document.querySelector("#cmp-app-container iframe");
1791
+ return !!iframe2.contentDocument?.querySelector(".cmp__dialog input");
1792
+ }, 5, 500);
1793
+ iframe = document.querySelector("#cmp-app-container iframe");
1794
+ settingsButton = iframe.contentDocument?.querySelector(".cmp-components-button.is-secondary");
1795
+ if (!settingsButton) {
1796
+ return false;
1797
+ }
1798
+ settingsButton.click();
1799
+ return true;
1800
+ }
1801
+ async optIn() {
1802
+ const iframe = document.querySelector("#cmp-app-container iframe");
1803
+ const acceptButton = iframe.contentDocument.querySelector(".cmp-components-button.is-primary");
1804
+ if (acceptButton) {
1805
+ acceptButton.click();
1806
+ return true;
1807
+ }
1808
+ return false;
1809
+ }
1810
+ };
1811
+
1755
1812
  // lib/cmps/all.ts
1756
1813
  var dynamicCMPs = [
1757
1814
  TrustArcTop,
@@ -1765,7 +1822,8 @@
1765
1822
  Uniconsent,
1766
1823
  Conversant,
1767
1824
  Tiktok,
1768
- Airbnb
1825
+ Airbnb,
1826
+ Tumblr
1769
1827
  ];
1770
1828
 
1771
1829
  // lib/dom-actions.ts
@@ -2240,12 +2298,7 @@
2240
2298
  const globalHidden = [
2241
2299
  "#didomi-popup,.didomi-popup-container,.didomi-popup-notice,.didomi-consent-popup-preferences,#didomi-notice,.didomi-popup-backdrop,.didomi-screen-medium"
2242
2300
  ];
2243
- const selectors = this.rules.reduce((selectorList, rule) => {
2244
- if (rule.prehideSelectors) {
2245
- return [...selectorList, ...rule.prehideSelectors];
2246
- }
2247
- return selectorList;
2248
- }, globalHidden);
2301
+ const selectors = this.rules.filter((rule) => rule.prehideSelectors && rule.checkRunContext()).reduce((selectorList, rule) => [...selectorList, ...rule.prehideSelectors], globalHidden);
2249
2302
  this.updateState({ prehideOn: true });
2250
2303
  setTimeout(() => {
2251
2304
  if (this.config.enablePrehide && this.state.prehideOn && !["runningOptOut", "runningOptIn"].includes(this.state.lifecycle)) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2024.3.15",
4
+ "version": "2024.3.26",
5
5
  "background": {
6
6
  "service_worker": "background.bundle.js"
7
7
  },