@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.
@@ -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/",
@@ -558,8 +558,8 @@ var snippets = {
558
558
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
559
559
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
560
560
  EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
561
- if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
562
- i.checked = false;
561
+ if (!i.disabled)
562
+ i.checked = i.name === "moove_gdpr_strict_cookies" || i.id === "moove_gdpr_strict_cookies";
563
563
  }) || true,
564
564
  EVAL_ONENINETWO_0: () => document.cookie.includes("CC_ADVERTISING=NO") && document.cookie.includes("CC_ANALYTICS=NO"),
565
565
  EVAL_OPERA_0: () => document.cookie.includes("cookie_consent_essential=true") && !document.cookie.includes("cookie_consent_marketing=true"),
@@ -1235,7 +1235,7 @@ var SourcePoint = class extends AutoConsentCMPBase {
1235
1235
  this.ccpaNotice = false;
1236
1236
  this.ccpaPopup = false;
1237
1237
  this.runContext = {
1238
- main: false,
1238
+ main: true,
1239
1239
  frame: true
1240
1240
  };
1241
1241
  }
@@ -1775,6 +1775,63 @@ var Airbnb = class extends AutoConsentCMPBase {
1775
1775
  }
1776
1776
  };
1777
1777
 
1778
+ // lib/cmps/tumblr-com.ts
1779
+ var Tumblr = class extends AutoConsentCMPBase {
1780
+ constructor() {
1781
+ super(...arguments);
1782
+ this.name = "tumblr-com";
1783
+ this.runContext = {
1784
+ "urlPattern": "^https://(www\\.)?tumblr\\.com/"
1785
+ };
1786
+ }
1787
+ get hasSelfTest() {
1788
+ return false;
1789
+ }
1790
+ get isIntermediate() {
1791
+ return false;
1792
+ }
1793
+ get isCosmetic() {
1794
+ return false;
1795
+ }
1796
+ get prehideSelectors() {
1797
+ return ["#cmp-app-container"];
1798
+ }
1799
+ async detectCmp() {
1800
+ return this.elementExists("#cmp-app-container");
1801
+ }
1802
+ async detectPopup() {
1803
+ return this.elementVisible("#cmp-app-container", "any");
1804
+ }
1805
+ async optOut() {
1806
+ let iframe = document.querySelector("#cmp-app-container iframe");
1807
+ let settingsButton = iframe.contentDocument?.querySelector(".cmp-components-button.is-secondary");
1808
+ if (!settingsButton) {
1809
+ return false;
1810
+ }
1811
+ settingsButton.click();
1812
+ await waitFor(() => {
1813
+ const iframe2 = document.querySelector("#cmp-app-container iframe");
1814
+ return !!iframe2.contentDocument?.querySelector(".cmp__dialog input");
1815
+ }, 5, 500);
1816
+ iframe = document.querySelector("#cmp-app-container iframe");
1817
+ settingsButton = iframe.contentDocument?.querySelector(".cmp-components-button.is-secondary");
1818
+ if (!settingsButton) {
1819
+ return false;
1820
+ }
1821
+ settingsButton.click();
1822
+ return true;
1823
+ }
1824
+ async optIn() {
1825
+ const iframe = document.querySelector("#cmp-app-container iframe");
1826
+ const acceptButton = iframe.contentDocument.querySelector(".cmp-components-button.is-primary");
1827
+ if (acceptButton) {
1828
+ acceptButton.click();
1829
+ return true;
1830
+ }
1831
+ return false;
1832
+ }
1833
+ };
1834
+
1778
1835
  // lib/cmps/all.ts
1779
1836
  var dynamicCMPs = [
1780
1837
  TrustArcTop,
@@ -1788,7 +1845,8 @@ var dynamicCMPs = [
1788
1845
  Uniconsent,
1789
1846
  Conversant,
1790
1847
  Tiktok,
1791
- Airbnb
1848
+ Airbnb,
1849
+ Tumblr
1792
1850
  ];
1793
1851
 
1794
1852
  // lib/dom-actions.ts
@@ -2263,12 +2321,7 @@ var AutoConsent = class {
2263
2321
  const globalHidden = [
2264
2322
  "#didomi-popup,.didomi-popup-container,.didomi-popup-notice,.didomi-consent-popup-preferences,#didomi-notice,.didomi-popup-backdrop,.didomi-screen-medium"
2265
2323
  ];
2266
- const selectors = this.rules.reduce((selectorList, rule) => {
2267
- if (rule.prehideSelectors) {
2268
- return [...selectorList, ...rule.prehideSelectors];
2269
- }
2270
- return selectorList;
2271
- }, globalHidden);
2324
+ const selectors = this.rules.filter((rule) => rule.prehideSelectors && rule.checkRunContext()).reduce((selectorList, rule) => [...selectorList, ...rule.prehideSelectors], globalHidden);
2272
2325
  this.updateState({ prehideOn: true });
2273
2326
  setTimeout(() => {
2274
2327
  if (this.config.enablePrehide && this.state.prehideOn && !["runningOptOut", "runningOptIn"].includes(this.state.lifecycle)) {
@@ -533,8 +533,8 @@ var snippets = {
533
533
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
534
534
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
535
535
  EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
536
- if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
537
- i.checked = false;
536
+ if (!i.disabled)
537
+ i.checked = i.name === "moove_gdpr_strict_cookies" || i.id === "moove_gdpr_strict_cookies";
538
538
  }) || true,
539
539
  EVAL_ONENINETWO_0: () => document.cookie.includes("CC_ADVERTISING=NO") && document.cookie.includes("CC_ANALYTICS=NO"),
540
540
  EVAL_OPERA_0: () => document.cookie.includes("cookie_consent_essential=true") && !document.cookie.includes("cookie_consent_marketing=true"),
@@ -1210,7 +1210,7 @@ var SourcePoint = class extends AutoConsentCMPBase {
1210
1210
  this.ccpaNotice = false;
1211
1211
  this.ccpaPopup = false;
1212
1212
  this.runContext = {
1213
- main: false,
1213
+ main: true,
1214
1214
  frame: true
1215
1215
  };
1216
1216
  }
@@ -1750,6 +1750,63 @@ var Airbnb = class extends AutoConsentCMPBase {
1750
1750
  }
1751
1751
  };
1752
1752
 
1753
+ // lib/cmps/tumblr-com.ts
1754
+ var Tumblr = class extends AutoConsentCMPBase {
1755
+ constructor() {
1756
+ super(...arguments);
1757
+ this.name = "tumblr-com";
1758
+ this.runContext = {
1759
+ "urlPattern": "^https://(www\\.)?tumblr\\.com/"
1760
+ };
1761
+ }
1762
+ get hasSelfTest() {
1763
+ return false;
1764
+ }
1765
+ get isIntermediate() {
1766
+ return false;
1767
+ }
1768
+ get isCosmetic() {
1769
+ return false;
1770
+ }
1771
+ get prehideSelectors() {
1772
+ return ["#cmp-app-container"];
1773
+ }
1774
+ async detectCmp() {
1775
+ return this.elementExists("#cmp-app-container");
1776
+ }
1777
+ async detectPopup() {
1778
+ return this.elementVisible("#cmp-app-container", "any");
1779
+ }
1780
+ async optOut() {
1781
+ let iframe = document.querySelector("#cmp-app-container iframe");
1782
+ let settingsButton = iframe.contentDocument?.querySelector(".cmp-components-button.is-secondary");
1783
+ if (!settingsButton) {
1784
+ return false;
1785
+ }
1786
+ settingsButton.click();
1787
+ await waitFor(() => {
1788
+ const iframe2 = document.querySelector("#cmp-app-container iframe");
1789
+ return !!iframe2.contentDocument?.querySelector(".cmp__dialog input");
1790
+ }, 5, 500);
1791
+ iframe = document.querySelector("#cmp-app-container iframe");
1792
+ settingsButton = iframe.contentDocument?.querySelector(".cmp-components-button.is-secondary");
1793
+ if (!settingsButton) {
1794
+ return false;
1795
+ }
1796
+ settingsButton.click();
1797
+ return true;
1798
+ }
1799
+ async optIn() {
1800
+ const iframe = document.querySelector("#cmp-app-container iframe");
1801
+ const acceptButton = iframe.contentDocument.querySelector(".cmp-components-button.is-primary");
1802
+ if (acceptButton) {
1803
+ acceptButton.click();
1804
+ return true;
1805
+ }
1806
+ return false;
1807
+ }
1808
+ };
1809
+
1753
1810
  // lib/cmps/all.ts
1754
1811
  var dynamicCMPs = [
1755
1812
  TrustArcTop,
@@ -1763,7 +1820,8 @@ var dynamicCMPs = [
1763
1820
  Uniconsent,
1764
1821
  Conversant,
1765
1822
  Tiktok,
1766
- Airbnb
1823
+ Airbnb,
1824
+ Tumblr
1767
1825
  ];
1768
1826
 
1769
1827
  // lib/dom-actions.ts
@@ -2238,12 +2296,7 @@ var AutoConsent = class {
2238
2296
  const globalHidden = [
2239
2297
  "#didomi-popup,.didomi-popup-container,.didomi-popup-notice,.didomi-consent-popup-preferences,#didomi-notice,.didomi-popup-backdrop,.didomi-screen-medium"
2240
2298
  ];
2241
- const selectors = this.rules.reduce((selectorList, rule) => {
2242
- if (rule.prehideSelectors) {
2243
- return [...selectorList, ...rule.prehideSelectors];
2244
- }
2245
- return selectorList;
2246
- }, globalHidden);
2299
+ const selectors = this.rules.filter((rule) => rule.prehideSelectors && rule.checkRunContext()).reduce((selectorList, rule) => [...selectorList, ...rule.prehideSelectors], globalHidden);
2247
2300
  this.updateState({ prehideOn: true });
2248
2301
  setTimeout(() => {
2249
2302
  if (this.config.enablePrehide && this.state.prehideOn && !["runningOptOut", "runningOptIn"].includes(this.state.lifecycle)) {