@duckduckgo/autoconsent 16.21.0 → 16.22.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 (33) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/addon-firefox/background.bundle.js +16 -2
  3. package/dist/addon-firefox/compact-rules.json +1 -1
  4. package/dist/addon-firefox/content.bundle.js +16 -2
  5. package/dist/addon-firefox/manifest.json +1 -1
  6. package/dist/addon-firefox/rule-index.json +1 -1
  7. package/dist/addon-firefox/rules.json +1 -1
  8. package/dist/addon-mv3/background.bundle.js +16 -2
  9. package/dist/addon-mv3/compact-rules.json +1 -1
  10. package/dist/addon-mv3/content.bundle.js +16 -2
  11. package/dist/addon-mv3/manifest.json +1 -1
  12. package/dist/addon-mv3/rule-index.json +1 -1
  13. package/dist/addon-mv3/rules.json +1 -1
  14. package/dist/autoconsent.cjs.js +16 -2
  15. package/dist/autoconsent.esm.js +16 -2
  16. package/dist/autoconsent.playwright.js +16 -2
  17. package/dist/autoconsent.standalone.js +17 -3
  18. package/dist/types/eval-snippets.d.ts +4 -1
  19. package/lib/eval-snippets.ts +16 -2
  20. package/package.json +1 -1
  21. package/rules/autoconsent/appconsent-legacy.json +31 -0
  22. package/rules/autoconsent/appconsent.json +31 -0
  23. package/rules/autoconsent/consentmanager-ncmp.json +34 -0
  24. package/rules/autoconsent/krown-cookie-banner.json +34 -0
  25. package/rules/autoconsent/pornpics-de.json +13 -0
  26. package/rules/compact-rules.json +1 -1
  27. package/rules/rule-index.json +1 -1
  28. package/rules/rules.json +1 -1
  29. package/tests/appconsent-legacy.spec.ts +7 -0
  30. package/tests/appconsent.spec.ts +7 -0
  31. package/tests/consentmanager-ncmp.spec.ts +5 -0
  32. package/tests/krown-cookie-banner.spec.ts +3 -0
  33. package/tests/pornpics-de.spec.ts +3 -0
@@ -258,11 +258,24 @@ var snippets = {
258
258
  const disabled = window.Didomi?.getUserConsentStatusForAll?.()?.purposes?.disabled;
259
259
  return Array.isArray(disabled) && disabled.length > 0;
260
260
  },
261
- EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
262
- EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
261
+ EVAL_CONSENTMANAGER_1: () => {
262
+ const cmpData = window.__cmp?.("getCMPData");
263
+ return !!cmpData && typeof cmpData === "object";
264
+ },
265
+ EVAL_CONSENTMANAGER_2: () => window.__cmp?.("consentStatus")?.userChoiceExists === false,
263
266
  EVAL_CONSENTMANAGER_3: () => __cmp("setConsent", 0),
264
267
  EVAL_CONSENTMANAGER_4: () => __cmp("setConsent", 1),
265
268
  EVAL_CONSENTMANAGER_5: () => __cmp("consentStatus").userChoiceExists,
269
+ EVAL_CONSENTMANAGER_NCMP_REJECT: () => {
270
+ if (typeof window.__npcmp !== "function") return false;
271
+ window.__npcmp("reject");
272
+ return true;
273
+ },
274
+ EVAL_CONSENTMANAGER_NCMP_ACCEPT: () => {
275
+ if (typeof window.__npcmp !== "function") return false;
276
+ window.__npcmp("save");
277
+ return true;
278
+ },
266
279
  EVAL_COOKIEBOT_1: () => !!window.Cookiebot,
267
280
  EVAL_COOKIEBOT_2: () => !window.Cookiebot.hasResponse && window.Cookiebot.dialog?.visible === true,
268
281
  EVAL_COOKIEBOT_3: () => window.Cookiebot.withdraw() || true,
@@ -355,6 +368,7 @@ var snippets = {
355
368
  if (x.checked) x.click();
356
369
  }) || true,
357
370
  EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
371
+ EVAL_KROWN_COOKIE_BANNER_TEST: () => localStorage.getItem("krown-cookie-banner") === "true",
358
372
  EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Reject|Ablehnen"))[0].click() || true,
359
373
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
360
374
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
@@ -228,11 +228,24 @@ var snippets = {
228
228
  const disabled = window.Didomi?.getUserConsentStatusForAll?.()?.purposes?.disabled;
229
229
  return Array.isArray(disabled) && disabled.length > 0;
230
230
  },
231
- EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
232
- EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
231
+ EVAL_CONSENTMANAGER_1: () => {
232
+ const cmpData = window.__cmp?.("getCMPData");
233
+ return !!cmpData && typeof cmpData === "object";
234
+ },
235
+ EVAL_CONSENTMANAGER_2: () => window.__cmp?.("consentStatus")?.userChoiceExists === false,
233
236
  EVAL_CONSENTMANAGER_3: () => __cmp("setConsent", 0),
234
237
  EVAL_CONSENTMANAGER_4: () => __cmp("setConsent", 1),
235
238
  EVAL_CONSENTMANAGER_5: () => __cmp("consentStatus").userChoiceExists,
239
+ EVAL_CONSENTMANAGER_NCMP_REJECT: () => {
240
+ if (typeof window.__npcmp !== "function") return false;
241
+ window.__npcmp("reject");
242
+ return true;
243
+ },
244
+ EVAL_CONSENTMANAGER_NCMP_ACCEPT: () => {
245
+ if (typeof window.__npcmp !== "function") return false;
246
+ window.__npcmp("save");
247
+ return true;
248
+ },
236
249
  EVAL_COOKIEBOT_1: () => !!window.Cookiebot,
237
250
  EVAL_COOKIEBOT_2: () => !window.Cookiebot.hasResponse && window.Cookiebot.dialog?.visible === true,
238
251
  EVAL_COOKIEBOT_3: () => window.Cookiebot.withdraw() || true,
@@ -325,6 +338,7 @@ var snippets = {
325
338
  if (x.checked) x.click();
326
339
  }) || true,
327
340
  EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
341
+ EVAL_KROWN_COOKIE_BANNER_TEST: () => localStorage.getItem("krown-cookie-banner") === "true",
328
342
  EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Reject|Ablehnen"))[0].click() || true,
329
343
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
330
344
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
@@ -230,11 +230,24 @@
230
230
  const disabled = window.Didomi?.getUserConsentStatusForAll?.()?.purposes?.disabled;
231
231
  return Array.isArray(disabled) && disabled.length > 0;
232
232
  },
233
- EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
234
- EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
233
+ EVAL_CONSENTMANAGER_1: () => {
234
+ const cmpData = window.__cmp?.("getCMPData");
235
+ return !!cmpData && typeof cmpData === "object";
236
+ },
237
+ EVAL_CONSENTMANAGER_2: () => window.__cmp?.("consentStatus")?.userChoiceExists === false,
235
238
  EVAL_CONSENTMANAGER_3: () => __cmp("setConsent", 0),
236
239
  EVAL_CONSENTMANAGER_4: () => __cmp("setConsent", 1),
237
240
  EVAL_CONSENTMANAGER_5: () => __cmp("consentStatus").userChoiceExists,
241
+ EVAL_CONSENTMANAGER_NCMP_REJECT: () => {
242
+ if (typeof window.__npcmp !== "function") return false;
243
+ window.__npcmp("reject");
244
+ return true;
245
+ },
246
+ EVAL_CONSENTMANAGER_NCMP_ACCEPT: () => {
247
+ if (typeof window.__npcmp !== "function") return false;
248
+ window.__npcmp("save");
249
+ return true;
250
+ },
238
251
  EVAL_COOKIEBOT_1: () => !!window.Cookiebot,
239
252
  EVAL_COOKIEBOT_2: () => !window.Cookiebot.hasResponse && window.Cookiebot.dialog?.visible === true,
240
253
  EVAL_COOKIEBOT_3: () => window.Cookiebot.withdraw() || true,
@@ -327,6 +340,7 @@
327
340
  if (x.checked) x.click();
328
341
  }) || true,
329
342
  EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
343
+ EVAL_KROWN_COOKIE_BANNER_TEST: () => localStorage.getItem("krown-cookie-banner") === "true",
330
344
  EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Reject|Ablehnen"))[0].click() || true,
331
345
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
332
346
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),