@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
@@ -19,11 +19,24 @@
19
19
  const disabled = window.Didomi?.getUserConsentStatusForAll?.()?.purposes?.disabled;
20
20
  return Array.isArray(disabled) && disabled.length > 0;
21
21
  },
22
- EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
23
- EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
22
+ EVAL_CONSENTMANAGER_1: () => {
23
+ const cmpData = window.__cmp?.("getCMPData");
24
+ return !!cmpData && typeof cmpData === "object";
25
+ },
26
+ EVAL_CONSENTMANAGER_2: () => window.__cmp?.("consentStatus")?.userChoiceExists === false,
24
27
  EVAL_CONSENTMANAGER_3: () => __cmp("setConsent", 0),
25
28
  EVAL_CONSENTMANAGER_4: () => __cmp("setConsent", 1),
26
29
  EVAL_CONSENTMANAGER_5: () => __cmp("consentStatus").userChoiceExists,
30
+ EVAL_CONSENTMANAGER_NCMP_REJECT: () => {
31
+ if (typeof window.__npcmp !== "function") return false;
32
+ window.__npcmp("reject");
33
+ return true;
34
+ },
35
+ EVAL_CONSENTMANAGER_NCMP_ACCEPT: () => {
36
+ if (typeof window.__npcmp !== "function") return false;
37
+ window.__npcmp("save");
38
+ return true;
39
+ },
27
40
  EVAL_COOKIEBOT_1: () => !!window.Cookiebot,
28
41
  EVAL_COOKIEBOT_2: () => !window.Cookiebot.hasResponse && window.Cookiebot.dialog?.visible === true,
29
42
  EVAL_COOKIEBOT_3: () => window.Cookiebot.withdraw() || true,
@@ -116,6 +129,7 @@
116
129
  if (x.checked) x.click();
117
130
  }) || true,
118
131
  EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
132
+ EVAL_KROWN_COOKIE_BANNER_TEST: () => localStorage.getItem("krown-cookie-banner") === "true",
119
133
  EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Reject|Ablehnen"))[0].click() || true,
120
134
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
121
135
  EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),