@duckduckgo/autoconsent 2.1.2 → 2.2.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 (93) hide show
  1. package/.vscode/.idea/.vscode.iml +9 -0
  2. package/.vscode/.idea/modules.xml +8 -0
  3. package/.vscode/.idea/workspace.xml +28 -0
  4. package/.vscode/settings.json +7 -0
  5. package/dist/addon-firefox/background.bundle.js +1 -1
  6. package/dist/addon-firefox/content.bundle.js +1 -1
  7. package/dist/addon-firefox/manifest.json +1 -1
  8. package/dist/addon-firefox/rules.json +821 -48
  9. package/dist/addon-mv3/background.bundle.js +1 -1
  10. package/dist/addon-mv3/content.bundle.js +1 -1
  11. package/dist/addon-mv3/manifest.json +1 -1
  12. package/dist/addon-mv3/rules.json +821 -48
  13. package/dist/autoconsent.cjs.js +1 -1
  14. package/dist/autoconsent.esm.js +1 -1
  15. package/dist/autoconsent.playwright.js +1 -1
  16. package/lib/cmps/all.ts +7 -0
  17. package/lib/cmps/base.ts +37 -24
  18. package/lib/cmps/consentmanager.ts +27 -4
  19. package/lib/cmps/conversant.ts +60 -0
  20. package/lib/cmps/klaro.ts +66 -0
  21. package/lib/cmps/sourcepoint-frame.ts +9 -8
  22. package/lib/cmps/sourcepoint-top.ts +5 -0
  23. package/lib/cmps/uniconsent.ts +70 -0
  24. package/lib/rules.ts +8 -1
  25. package/lib/web.ts +35 -25
  26. package/package.json +1 -1
  27. package/readme.md +29 -0
  28. package/rules/autoconsent/adroll.json +11 -0
  29. package/rules/autoconsent/aws-amazon.json +6 -1
  30. package/rules/autoconsent/axeptio.json +41 -0
  31. package/rules/autoconsent/clickio.json +18 -0
  32. package/rules/autoconsent/complianz-banner.json +13 -0
  33. package/rules/autoconsent/complianz-categories.json +17 -0
  34. package/rules/autoconsent/complianz-notice.json +14 -0
  35. package/rules/autoconsent/complianz-optin.json +20 -0
  36. package/rules/autoconsent/cookie-notice.json +3 -1
  37. package/rules/autoconsent/cookieinformation.json +14 -0
  38. package/rules/autoconsent/dsgvo.json +16 -0
  39. package/rules/autoconsent/eu-cookie-law.json +20 -0
  40. package/rules/autoconsent/ezoic.json +19 -0
  41. package/rules/autoconsent/iubenda.json +23 -0
  42. package/rules/autoconsent/jquery-cookiebar.json +25 -0
  43. package/rules/autoconsent/mediavine.json +20 -0
  44. package/rules/autoconsent/moove.json +28 -0
  45. package/rules/autoconsent/paypal.json +4 -1
  46. package/rules/autoconsent/primebox.json +19 -0
  47. package/rules/autoconsent/sirdata.json +11 -0
  48. package/rules/autoconsent/tarteaucitron.json +18 -0
  49. package/rules/autoconsent/tealium.json +0 -1
  50. package/rules/autoconsent/termly.json +31 -0
  51. package/rules/autoconsent/testcmp.json +4 -1
  52. package/rules/autoconsent/uk-cookie-consent.json +15 -0
  53. package/rules/autoconsent/{usercentrics-1.json → usercentrics-api.json} +2 -2
  54. package/rules/autoconsent/usercentrics-button.json +14 -0
  55. package/rules/autoconsent/vodafone-de.json +5 -5
  56. package/rules/autoconsent/wp-cookie-notice.json +12 -0
  57. package/rules/rules.json +821 -48
  58. package/tests/adroll.spec.ts +15 -0
  59. package/tests/axeptio.spec.ts +9 -0
  60. package/tests/clickio.spec.ts +10 -0
  61. package/tests/complianz-banner.spec.ts +9 -0
  62. package/tests/complianz-categories.spec.ts +14 -0
  63. package/tests/{cookieconsent.spec.ts → complianz-notice.spec.ts} +1 -2
  64. package/tests/complianz-optin.spec.ts +6 -0
  65. package/tests/consentmanager.spec.ts +2 -1
  66. package/tests/conversant.spec.ts +10 -0
  67. package/tests/{cookienotice.spec.ts → cookie-notice.spec.ts} +0 -0
  68. package/tests/cookieinformation.spec.ts +10 -0
  69. package/tests/dsgvo.spec.ts +6 -0
  70. package/tests/eu-cookie-law.spec.ts +6 -0
  71. package/tests/ezoic.spec.ts +8 -0
  72. package/tests/iubenda.spec.ts +8 -0
  73. package/tests/jquery-cookiebar.spec.ts +6 -0
  74. package/tests/klaro.spec.ts +6 -2
  75. package/tests/mediavine.spec.ts +8 -0
  76. package/tests/moove.spec.ts +13 -0
  77. package/tests/onetrust.spec.ts +2 -2
  78. package/tests/primebox.spec.ts +7 -0
  79. package/tests/sirdata.spec.ts +8 -0
  80. package/tests/tarteaucitron.spec.ts +9 -0
  81. package/tests/tealium.spec.ts +1 -1
  82. package/tests/termly.spec.ts +12 -0
  83. package/tests/trustarc.spec.ts +1 -9
  84. package/tests/uk-cookie-consent.spec.ts +7 -0
  85. package/tests/uniconsent.spec.ts +12 -0
  86. package/tests/{usercentrics-1.spec.ts → usercentrics-api.spec.ts} +3 -2
  87. package/tests/usercentrics-button.spec.ts +8 -0
  88. package/tests/wp-cookie-notice.spec.ts +8 -0
  89. package/dist/autoconsent.standalone.js +0 -1
  90. package/rules/autoconsent/cookieconsent.json +0 -8
  91. package/rules/autoconsent/destatis-de.json +0 -8
  92. package/rules/autoconsent/klaro.json +0 -10
  93. package/tests/destatis.spec.ts +0 -7
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "cookie-notice",
3
3
  "prehideSelectors": ["#cookie-notice"],
4
- "detectCmp": [{ "exists": "#cookie-notice" }],
4
+ "detectCmp": [
5
+ { "visible": "#cookie-notice .cookie-notice-container" }
6
+ ],
5
7
  "detectPopup": [{ "visible": "#cookie-notice" }],
6
8
  "optIn": [{ "click": ["#cn-accept-cookie"] }],
7
9
  "optOut": [{ "hide": ["#cookie-notice"] }]
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "Cookie Information Banner",
3
+ "prehideSelectors": ["#cookie-information-template-wrapper"],
4
+ "detectCmp": [{ "exists": "#cookie-information-template-wrapper" }],
5
+ "detectPopup": [{ "visible": "#cookie-information-template-wrapper" }],
6
+ "optIn": [ { "eval": "CookieInformation.submitAllCategories() || true"} ],
7
+ "optOut": [
8
+ { "hide": ["#cookie-information-template-wrapper"], "comment": "some templates don't hide the banner automatically" },
9
+ { "eval": "CookieInformation.declineAllCategories() || true"}
10
+ ],
11
+ "test": [
12
+ { "eval": "document.cookie.includes('CookieInformationConsent=')" }
13
+ ]
14
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "WP DSGVO Tools",
3
+ "link": "https://wordpress.org/plugins/shapepress-dsgvo/",
4
+ "prehideSelectors": [".sp-dsgvo"],
5
+ "detectCmp": [{ "exists": ".sp-dsgvo.sp-dsgvo-popup-overlay" }],
6
+ "detectPopup": [{ "visible": ".sp-dsgvo.sp-dsgvo-popup-overlay", "check": "any" }],
7
+ "optIn": [
8
+ { "click": ".sp-dsgvo-privacy-btn-accept-all", "all": true }
9
+ ],
10
+ "optOut": [
11
+ { "hide": [".sp-dsgvo.sp-dsgvo-popup-overlay"] }
12
+ ],
13
+ "test": [
14
+ { "eval": "!document.cookie.includes('sp_dsgvo_cookie_settings')" }
15
+ ]
16
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "EU Cookie Law",
3
+ "prehideSelectors": [".pea_cook_wrapper,.pea_cook_more_info_popover"],
4
+ "detectCmp": [{ "exists": ".pea_cook_wrapper" }],
5
+ "detectPopup": [
6
+ { "wait": 500 },
7
+ { "visible": ".pea_cook_wrapper" }
8
+ ],
9
+ "optIn": [
10
+ {
11
+ "click": "#pea_cook_btn"
12
+ }
13
+ ],
14
+ "optOut": [
15
+ { "hide": [".pea_cook_wrapper"] }
16
+ ],
17
+ "test": [
18
+ { "eval": "!document.cookie.includes('euCookie')" }
19
+ ]
20
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "EZoic",
3
+ "prehideSelectors": ["#ez-cookie-dialog-wrapper"],
4
+ "detectCmp": [{ "exists": "#ez-cookie-dialog-wrapper" }],
5
+ "detectPopup": [{ "visible": "#ez-cookie-dialog-wrapper" }],
6
+ "optIn": [
7
+ { "click": "#ez-accept-all", "optional": true },
8
+ { "eval": "ezCMP.handleAcceptAllClick()", "optional": true }
9
+ ],
10
+ "optOut": [
11
+ { "click": "#ez-manage-settings" },
12
+ { "waitFor": "#ez-cookie-dialog input[type=checkbox]" },
13
+ { "click": "#ez-cookie-dialog input[type=checkbox][checked]", "all": true },
14
+ { "click": "#ez-save-settings" }
15
+ ],
16
+ "test": [
17
+ { "eval": "!!document.cookie.match(/ezCMPCookieConsent=[^;]+\\|2=0\\|3=0\\|4=0/)" }
18
+ ]
19
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "iubenda",
3
+ "prehideSelectors": ["#iubenda-cs-banner"],
4
+ "detectCmp": [{ "exists": "#iubenda-cs-banner" }],
5
+ "detectPopup": [{ "visible": ".iubenda-cs-accept-btn" }],
6
+ "optIn": [
7
+ { "click": ".iubenda-cs-accept-btn" }
8
+ ],
9
+ "optOut": [
10
+ {
11
+ "click": ".iubenda-cs-customize-btn"
12
+ },
13
+ {
14
+ "eval": "document.querySelectorAll('.purposes-item input[type=checkbox]:not([disabled])').forEach(x => {if(x.checked) x.click()}) || true"
15
+ },
16
+ {
17
+ "click": "#iubFooterBtn"
18
+ }
19
+ ],
20
+ "test": [
21
+ { "eval": "!!document.cookie.match(/_iub_cs-\\d+=/)" }
22
+ ]
23
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "jquery.cookieBar",
3
+ "comment": "https://github.com/kovarp/jquery.cookieBar",
4
+ "prehideSelectors": [".cookie-bar"],
5
+ "detectCmp": [{ "exists": ".cookie-bar .cookie-bar__message,.cookie-bar .cookie-bar__buttons" }],
6
+ "detectPopup": [{
7
+ "visible": ".cookie-bar .cookie-bar__message,.cookie-bar .cookie-bar__buttons",
8
+ "check": "any"
9
+ }],
10
+ "optIn": [
11
+ { "click": ".cookie-bar .cookie-bar__btn" }
12
+ ],
13
+ "optOut": [
14
+ { "hide": [".cookie-bar"] }
15
+ ],
16
+ "test": [
17
+ {
18
+ "visible": ".cookie-bar .cookie-bar__message,.cookie-bar .cookie-bar__buttons",
19
+ "check": "none"
20
+ },
21
+ {
22
+ "eval": "!document.cookie.includes('cookies-state=accepted')"
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "Mediavine",
3
+ "prehideSelectors": ["[data-name=\"mediavine-gdpr-cmp\"]"],
4
+ "detectCmp": [{ "exists": "[data-name=\"mediavine-gdpr-cmp\"]" }],
5
+ "detectPopup": [
6
+ { "wait": 500 },
7
+ { "visible": "[data-name=\"mediavine-gdpr-cmp\"]" }
8
+ ],
9
+ "optIn": [
10
+ {
11
+ "waitForThenClick": "[data-name=\"mediavine-gdpr-cmp\"] [format=\"primary\"]"
12
+ }
13
+ ],
14
+ "optOut": [
15
+ { "waitForThenClick": "[data-name=\"mediavine-gdpr-cmp\"] [data-view=\"manageSettings\"]" },
16
+ { "waitFor": "[data-name=\"mediavine-gdpr-cmp\"] input[type=checkbox]" },
17
+ { "eval": "document.querySelectorAll(\"[data-name=\\\"mediavine-gdpr-cmp\\\"] input[type=checkbox]\").forEach(x => x.checked && x.click()) || true", "optional": true },
18
+ { "click": "[data-name=\"mediavine-gdpr-cmp\"] [format=\"secondary\"]" }
19
+ ]
20
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Moove",
3
+ "prehideSelectors": ["#moove_gdpr_cookie_info_bar"],
4
+ "detectCmp": [{ "exists": "#moove_gdpr_cookie_info_bar" }],
5
+ "detectPopup": [{ "visible": "#moove_gdpr_cookie_info_bar" }],
6
+ "optIn": [
7
+ { "waitForThenClick": ".moove-gdpr-infobar-allow-all" }
8
+ ],
9
+ "optOut": [
10
+ {
11
+ "if": {
12
+ "exists": "#moove_gdpr_cookie_info_bar .change-settings-button"
13
+ },
14
+ "then": [
15
+ { "click": "#moove_gdpr_cookie_info_bar .change-settings-button" },
16
+ { "waitForVisible": "#moove_gdpr_cookie_modal" },
17
+ { "eval": "document.querySelectorAll('#moove_gdpr_cookie_modal input').forEach(i => { if (!i.disabled) i.checked = false }) || true" },
18
+ { "click": ".moove-gdpr-modal-save-settings" }
19
+ ],
20
+ "else": [
21
+ { "hide": ["#moove_gdpr_cookie_info_bar"] }
22
+ ]
23
+ }
24
+ ],
25
+ "test": [
26
+ { "visible": "#moove_gdpr_cookie_info_bar", "check": "none" }
27
+ ]
28
+ }
@@ -12,5 +12,8 @@
12
12
  "click": ".gdprCookieBanner_decline-button"
13
13
  }
14
14
  ],
15
- "test": [{"eval": "document.cookie.includes('cookie_prefs') === true"}]
15
+ "test": [
16
+ { "wait": 500 },
17
+ { "eval": "document.cookie.includes('cookie_prefs') === true" }
18
+ ]
16
19
  }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "PrimeBox CookieBar",
3
+ "prehideSelectors": ["#cookie-bar"],
4
+ "detectCmp": [{ "exists": "#cookie-bar .cb-enable,#cookie-bar .cb-disable,#cookie-bar .cb-policy" }],
5
+ "detectPopup": [{
6
+ "visible": "#cookie-bar .cb-enable,#cookie-bar .cb-disable,#cookie-bar .cb-policy",
7
+ "check": "any"
8
+ }],
9
+ "optIn": [
10
+ { "waitForThenClick": "#cookie-bar .cb-enable" }
11
+ ],
12
+ "optOut": [
13
+ { "click": "#cookie-bar .cb-disable", "optional": true },
14
+ { "hide": ["#cookie-bar"] }
15
+ ],
16
+ "test": [
17
+ { "eval": "!document.cookie.includes('cb-enabled=accepted')" }
18
+ ]
19
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "Sirdata",
3
+ "prehideSelectors": ["#sd-cmp"],
4
+ "detectCmp": [{ "exists": "#sd-cmp" }],
5
+ "detectPopup": [{ "visible": "#sd-cmp" }],
6
+ "optIn": [ { "waitForThenClick": "#sd-cmp .sd-cmp-3cRQ2" } ],
7
+ "optOut": [ { "waitForThenClick": "#sd-cmp .sd-cmp-1pO44" } ],
8
+ "test": [
9
+ { "eval": "document.cookie.includes('euconsent-v2')" }
10
+ ]
11
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "tarteaucitron.js",
3
+ "prehideSelectors": ["#tarteaucitronRoot"],
4
+ "detectCmp": [{ "exists": "#tarteaucitronRoot" }],
5
+ "detectPopup": [{
6
+ "visible": "#tarteaucitronRoot #tarteaucitronAlertSmall,#tarteaucitronRoot #tarteaucitronAlertBig",
7
+ "check": "any"
8
+ }],
9
+ "optIn": [
10
+ { "eval": "tarteaucitron.userInterface.respondAll(true) || true" }
11
+ ],
12
+ "optOut": [
13
+ { "eval": "tarteaucitron.userInterface.respondAll(false) || true" }
14
+ ],
15
+ "test": [
16
+ { "eval": "document.cookie.match(/tarteaucitron=[^;]*/)[0].includes('false')", "comment": "sometimes there are required categories, so we check that at least something is false" }
17
+ ]
18
+ }
@@ -4,7 +4,6 @@
4
4
  "detectCmp": [{ "visible": "#__tealiumGDPRecModal" }, { "eval": "typeof window.utag !== 'undefined' && typeof utag.gdpr === 'object'" }],
5
5
  "detectPopup": [{ "visible": "#__tealiumGDPRecModal" }],
6
6
  "optOut": [
7
- { "hide": ["#__tealiumGDPRecModal", "#__tealiumGDPRcpPrefs", "#consent-layer"] },
8
7
  { "waitForThenClick": "#cm-acceptNone,.js-accept-essential-cookies", "timeout": 1000 },
9
8
  { "eval": "utag.gdpr.setConsentValue(false) || true" }
10
9
  ],
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "Termly",
3
+ "prehideSelectors": ["#termly-code-snippet-support"],
4
+ "detectCmp": [{ "exists": "#termly-code-snippet-support" }],
5
+ "detectPopup": [{ "visible": "#termly-code-snippet-support div" }],
6
+ "optIn": [
7
+ { "waitForThenClick": "[data-tid=\"banner-accept\"]" }
8
+ ],
9
+ "optOut": [
10
+ {
11
+ "if": { "exists": "[data-tid=\"banner-decline\"]" },
12
+ "then": [
13
+ { "click": "[data-tid=\"banner-decline\"]" }
14
+ ],
15
+ "else": [
16
+ { "click": ".t-preference-button" },
17
+ { "wait": 500 },
18
+ {
19
+ "if": { "exists": ".t-declineAllButton" },
20
+ "then": [
21
+ { "click": ".t-declineAllButton" }
22
+ ],
23
+ "else": [
24
+ { "waitForThenClick": ".t-preference-modal input[type=checkbox][checked]:not([disabled])", "all": true },
25
+ { "waitForThenClick": ".t-saveButton" }
26
+ ]
27
+ }
28
+ ]
29
+ }
30
+ ]
31
+ }
@@ -3,7 +3,10 @@
3
3
  "prehideSelectors": ["#reject-all"],
4
4
  "detectCmp": [{ "exists": "#privacy-test-page-cmp-test" }],
5
5
  "detectPopup": [{ "visible": "#privacy-test-page-cmp-test" }],
6
- "optIn": [{ "click": "#accept-all" }],
6
+ "optIn": [
7
+ { "waitFor": "#accept-all" },
8
+ { "click": "#accept-all" }
9
+ ],
7
10
  "optOut": [
8
11
  { "waitFor": "#reject-all" },
9
12
  { "click": "#reject-all" }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "UK Cookie Consent",
3
+ "prehideSelectors": ["#catapult-cookie-bar"],
4
+ "detectCmp": [{ "exists": "#catapult-cookie-bar" }],
5
+ "detectPopup": [{ "exists": ".has-cookie-bar #catapult-cookie-bar" }],
6
+ "optIn": [
7
+ { "click": "#catapultCookie" }
8
+ ],
9
+ "optOut": [
10
+ { "hide": ["#catapult-cookie-bar"] }
11
+ ],
12
+ "test": [
13
+ { "eval": "!document.cookie.includes('catAccCookies')" }
14
+ ]
15
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "name": "usercentrics-1",
2
+ "name": "usercentrics-api",
3
3
  "detectCmp": [{ "exists": "#usercentrics-root" }],
4
4
  "detectPopup": [
5
5
  {
6
- "eval": "!!document.querySelector('#usercentrics-root').shadowRoot.querySelector('#uc-center-container')"
6
+ "eval": "typeof UC_UI === 'object'"
7
7
  }
8
8
  ],
9
9
  "optIn": [
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "usercentrics-button",
3
+ "detectCmp": [{ "exists": "#usercentrics-button" }],
4
+ "detectPopup": [
5
+ { "visible": "#usercentrics-button #uc-btn-accept-banner" }
6
+ ],
7
+ "optIn": [
8
+ { "click": "#usercentrics-button #uc-btn-accept-banner" }
9
+ ],
10
+ "optOut": [
11
+ { "click": "#usercentrics-button #uc-btn-deny-banner" }
12
+ ],
13
+ "test": [{ "eval": "JSON.parse(localStorage.getItem('usercentrics')).consents.every(c => c.isEssential || !c.consentStatus)" }]
14
+ }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "vodafone.de",
3
+ "runContext": {
4
+ "url": "https://www.vodafone.de/"
5
+ },
3
6
  "prehideSelectors": [".dip-consent,.dip-consent-container"],
4
7
  "detectCmp": [{ "exists": ".dip-consent-container" }],
5
8
  "detectPopup": [{ "visible": ".dip-consent-content" }],
6
9
  "optOut": [
7
- { "click": ".dip-consent-btn.white-btn" },
8
- {
9
- "eval": "Array.from(document.querySelectorAll('.dip-consent-btn.red-btn')).filter(e => e.innerText === 'Auswahl bestätigen')[0].click() || true"
10
- }
10
+ { "click": ".dip-consent-btn[tabindex=\"2\"]" }
11
11
  ],
12
- "optIn": [{ "click": ".dip-consent-btn.red-btn" }]
12
+ "optIn": [{ "click": ".dip-consent-btn[tabindex=\"1\"]" }]
13
13
  }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "WP Cookie Notice for GDPR",
3
+ "comment": "https://wordpress.org/plugins/gdpr-cookie-consent/",
4
+ "prehideSelectors": ["#gdpr-cookie-consent-bar"],
5
+ "detectCmp": [{ "exists": "#gdpr-cookie-consent-bar" }],
6
+ "detectPopup": [{ "visible": "#gdpr-cookie-consent-bar" }],
7
+ "optIn": [ { "waitForThenClick": "#gdpr-cookie-consent-bar #cookie_action_accept" } ],
8
+ "optOut": [ { "waitForThenClick": "#gdpr-cookie-consent-bar #cookie_action_reject" } ],
9
+ "test": [
10
+ { "eval": "document.cookie.includes('wpl_viewed_cookie=no')" }
11
+ ]
12
+ }