@duckduckgo/autoconsent 6.4.1 → 6.4.3

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.
@@ -629,10 +629,11 @@ var snippets = {
629
629
  EVAL_CONSENTMANAGER_3: () => __cmp("setConsent", 0),
630
630
  EVAL_CONSENTMANAGER_4: () => __cmp("setConsent", 1),
631
631
  EVAL_CONSENTMANAGER_5: () => __cmp("consentStatus").userChoiceExists,
632
- EVAL_COOKIEBOT_1: () => window.CookieConsent.hasResponse !== true,
633
- EVAL_COOKIEBOT_2: () => window.Cookiebot.dialog.submitConsent(),
634
- EVAL_COOKIEBOT_3: () => endCookieProcess(),
635
- EVAL_COOKIEBOT_4: () => window.CookieConsent.declined === true,
632
+ EVAL_COOKIEBOT_1: () => !!window.Cookiebot,
633
+ EVAL_COOKIEBOT_2: () => !window.Cookiebot.hasResponse && window.Cookiebot.dialog?.visible === true,
634
+ EVAL_COOKIEBOT_3: () => window.Cookiebot.withdraw() || true,
635
+ EVAL_COOKIEBOT_4: () => window.Cookiebot.hide() || true,
636
+ EVAL_COOKIEBOT_5: () => window.Cookiebot.declined === true,
636
637
  EVAL_KLARO_1: () => klaro.getManager().config.services.every((c) => c.required || !klaro.getManager().consents[c.name]),
637
638
  EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
638
639
  EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
@@ -663,6 +664,7 @@ var snippets = {
663
664
  EVAL_COOKIEINFORMATION_0: () => CookieInformation.declineAllCategories() || true,
664
665
  EVAL_COOKIEINFORMATION_1: () => CookieInformation.submitAllCategories() || true,
665
666
  EVAL_COOKIEINFORMATION_2: () => document.cookie.includes("CookieInformationConsent="),
667
+ EVAL_COOKIEYES_0: () => document.cookie.includes("advertisement:no"),
666
668
  EVAL_DAILYMOTION_0: () => !!document.cookie.match("dm-euconsent-v2"),
667
669
  EVAL_DSGVO_0: () => !document.cookie.includes("sp_dsgvo_cookie_settings"),
668
670
  EVAL_DUNELM_0: () => document.cookie.includes("cc_functional=0") && document.cookie.includes("cc_targeting=0"),
@@ -770,6 +772,7 @@ var AutoConsentCMPBase = class {
770
772
  return Promise.resolve(result);
771
773
  }
772
774
  const snippetSrc = getFunctionBody(snippet);
775
+ enableLogs && console.log("async eval:", snippetId, snippetSrc);
773
776
  return requestEval(snippetSrc).catch((e) => {
774
777
  enableLogs && console.error("error evaluating rule", snippetId, e);
775
778
  return false;
@@ -1173,7 +1176,7 @@ var Cookiebot = class extends AutoConsentCMPBase {
1173
1176
  constructor() {
1174
1177
  super(...arguments);
1175
1178
  this.name = "Cybotcookiebot";
1176
- this.prehideSelectors = ["#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookieoverlay"];
1179
+ this.prehideSelectors = ["#CybotCookiebotDialog,#CybotCookiebotDialogBodyUnderlay,#dtcookie-container,#cookiebanner,#cb-cookieoverlay,.modal--cookie-banner,#cookiebanner_outer,#CookieBanner"];
1177
1180
  }
1178
1181
  get hasSelfTest() {
1179
1182
  return true;
@@ -1185,44 +1188,19 @@ var Cookiebot = class extends AutoConsentCMPBase {
1185
1188
  return false;
1186
1189
  }
1187
1190
  async detectCmp() {
1188
- return elementExists("#CybotCookiebotDialogBodyLevelButtonPreferences");
1191
+ return await this.mainWorldEval("EVAL_COOKIEBOT_1");
1189
1192
  }
1190
1193
  async detectPopup() {
1191
- return elementExists("#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookiebanner");
1194
+ return await waitFor(() => {
1195
+ return this.mainWorldEval("EVAL_COOKIEBOT_2");
1196
+ }, 10, 500);
1192
1197
  }
1193
1198
  async optOut() {
1194
- if (click(".cookie-alert-extended-detail-link")) {
1195
- await waitForElement(".cookie-alert-configuration", 2e3);
1196
- click(".cookie-alert-configuration-input:checked", true);
1197
- click(".cookie-alert-extended-button-secondary");
1198
- return true;
1199
- }
1200
- if (elementExists("#dtcookie-container")) {
1201
- return click(".h-dtcookie-decline");
1202
- }
1203
- if (click(".cookiebot__button--settings")) {
1204
- return true;
1205
- }
1206
- if (click("#CybotCookiebotDialogBodyButtonDecline")) {
1207
- return true;
1208
- }
1209
- click(".cookiebanner__link--details");
1210
- click('.CybotCookiebotDialogBodyLevelButton:checked:enabled,input[id*="CybotCookiebotDialogBodyLevelButton"]:checked:enabled', true);
1211
- click("#CybotCookiebotDialogBodyButtonDecline");
1212
- click("input[id^=CybotCookiebotDialogBodyLevelButton]:checked", true);
1213
- if (elementExists("#CybotCookiebotDialogBodyButtonAcceptSelected")) {
1214
- click("#CybotCookiebotDialogBodyButtonAcceptSelected");
1215
- } else {
1216
- click("#CybotCookiebotDialogBodyLevelButtonAccept,#CybotCookiebotDialogBodyButtonAccept,#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection", true);
1217
- }
1218
- if (await this.mainWorldEval("EVAL_COOKIEBOT_1")) {
1219
- await this.mainWorldEval("EVAL_COOKIEBOT_2");
1220
- await wait(500);
1221
- }
1222
- if (elementExists("#cb-confirmedSettings")) {
1223
- await this.mainWorldEval("EVAL_COOKIEBOT_3");
1224
- }
1225
- return true;
1199
+ await wait(500);
1200
+ let res = await this.mainWorldEval("EVAL_COOKIEBOT_3");
1201
+ await wait(500);
1202
+ res = res && await this.mainWorldEval("EVAL_COOKIEBOT_4");
1203
+ return res;
1226
1204
  }
1227
1205
  async optIn() {
1228
1206
  if (elementExists("#dtcookie-container")) {
@@ -1234,7 +1212,8 @@ var Cookiebot = class extends AutoConsentCMPBase {
1234
1212
  return true;
1235
1213
  }
1236
1214
  async test() {
1237
- return this.mainWorldEval("EVAL_COOKIEBOT_4");
1215
+ await wait(500);
1216
+ return await this.mainWorldEval("EVAL_COOKIEBOT_5");
1238
1217
  }
1239
1218
  };
1240
1219