@duckduckgo/autoconsent 1.0.7 → 2.1.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 (187) hide show
  1. package/.eslintrc.cjs +14 -0
  2. package/.vscode/.idea/.vscode.iml +9 -0
  3. package/.vscode/.idea/modules.xml +8 -0
  4. package/.vscode/.idea/workspace.xml +28 -0
  5. package/.vscode/settings.json +7 -0
  6. package/Jenkinsfile +68 -39
  7. package/api.md +104 -0
  8. package/dist/addon-firefox/background.bundle.js +1 -0
  9. package/dist/addon-firefox/content.bundle.js +1 -0
  10. package/dist/addon-firefox/icons/cog.png +0 -0
  11. package/dist/addon-firefox/icons/cookie-idle.png +0 -0
  12. package/dist/addon-firefox/icons/cookie.png +0 -0
  13. package/dist/addon-firefox/icons/party.png +0 -0
  14. package/dist/addon-firefox/icons/tick.png +0 -0
  15. package/dist/addon-firefox/icons/verified.png +0 -0
  16. package/dist/addon-firefox/rules.json +4167 -0
  17. package/dist/addon-mv3/background.bundle.js +1 -0
  18. package/dist/addon-mv3/content.bundle.js +1 -0
  19. package/dist/addon-mv3/icons/cog.png +0 -0
  20. package/dist/addon-mv3/icons/cookie-idle.png +0 -0
  21. package/dist/addon-mv3/icons/cookie.png +0 -0
  22. package/dist/addon-mv3/icons/party.png +0 -0
  23. package/dist/addon-mv3/icons/tick.png +0 -0
  24. package/dist/addon-mv3/icons/verified.png +0 -0
  25. package/dist/addon-mv3/rules.json +4167 -0
  26. package/dist/autoconsent.cjs.js +1 -1383
  27. package/dist/autoconsent.esm.js +1 -1375
  28. package/dist/autoconsent.playwright.js +1 -0
  29. package/lib/cmps/all.ts +15 -10
  30. package/lib/cmps/base.ts +95 -90
  31. package/lib/cmps/consentmanager.ts +31 -19
  32. package/lib/cmps/consentomatic.ts +89 -0
  33. package/lib/cmps/cookiebot.ts +62 -53
  34. package/lib/cmps/evidon.ts +29 -18
  35. package/lib/cmps/onetrust.ts +32 -20
  36. package/lib/cmps/sourcepoint-frame.ts +104 -0
  37. package/lib/cmps/sourcepoint-top.ts +47 -0
  38. package/lib/cmps/trustarc-frame.ts +115 -0
  39. package/lib/cmps/trustarc-top.ts +97 -0
  40. package/lib/consentomatic/index.ts +233 -70
  41. package/lib/{web/consentomatic → consentomatic}/tools.ts +0 -0
  42. package/lib/eval-handler.ts +58 -0
  43. package/lib/index.ts +0 -2
  44. package/lib/messages.ts +100 -0
  45. package/lib/rule-executors.ts +108 -0
  46. package/lib/rules.ts +82 -0
  47. package/lib/types.ts +35 -0
  48. package/lib/utils.ts +64 -0
  49. package/lib/web.ts +288 -74
  50. package/package.json +20 -16
  51. package/playwright/content.ts +21 -0
  52. package/playwright/runner.ts +162 -0
  53. package/playwright.config.ts +7 -0
  54. package/readme.md +61 -47
  55. package/rollup.config.js +30 -16
  56. package/rules/autoconsent/192.json +17 -0
  57. package/rules/autoconsent/ausopen.json +8 -0
  58. package/rules/autoconsent/baden-wuerttemberg-de.json +7 -3
  59. package/rules/autoconsent/bing.json +14 -0
  60. package/rules/autoconsent/bundesregierung-de.json +5 -1
  61. package/rules/autoconsent/cc-banner.json +0 -1
  62. package/rules/autoconsent/cookie-law-info.json +1 -1
  63. package/rules/autoconsent/cookie-notice.json +1 -2
  64. package/rules/autoconsent/cookieconsent.json +5 -6
  65. package/rules/autoconsent/destatis-de.json +2 -2
  66. package/rules/autoconsent/dunelm.json +18 -0
  67. package/rules/autoconsent/etsy.json +4 -3
  68. package/rules/autoconsent/eu-cookie-compliance.json +0 -1
  69. package/rules/autoconsent/gov-uk.json +10 -0
  70. package/rules/autoconsent/hl-co-uk.json +8 -9
  71. package/rules/autoconsent/johnlewis.json +5 -2
  72. package/rules/autoconsent/marksandspencer.json +8 -0
  73. package/rules/autoconsent/mediamarkt-de.json +1 -1
  74. package/rules/autoconsent/microsoft.json +1 -1
  75. package/rules/autoconsent/notice-cookie.json +0 -1
  76. package/rules/autoconsent/osano.json +4 -2
  77. package/rules/autoconsent/{paypal-de.json → paypal.json} +6 -2
  78. package/rules/autoconsent/snigel.json +2 -1
  79. package/rules/autoconsent/tealium.json +4 -5
  80. package/rules/autoconsent/thefreedictionary.json +1 -1
  81. package/rules/autoconsent/uswitch.json +8 -0
  82. package/rules/autoconsent/waitrose.json +28 -0
  83. package/rules/autoconsent/wetransfer.json +7 -0
  84. package/rules/rules.json +345 -45
  85. package/tests/192.spec.ts +7 -0
  86. package/tests/arzt-auskunft.spec.ts +1 -1
  87. package/tests/asus.spec.ts +1 -1
  88. package/tests/ausopen.spec.ts +7 -0
  89. package/tests/aws.amazon.spec.ts +1 -1
  90. package/tests/baden-wuerttemberg.spec.ts +1 -1
  91. package/tests/borlabs.spec.ts +1 -1
  92. package/tests/bundesregierung.spec.ts +5 -2
  93. package/tests/ccbanner.spec.ts +1 -1
  94. package/tests/consentmanager.spec.ts +3 -3
  95. package/tests/cookiebot.spec.ts +8 -1
  96. package/tests/cookieconsent.spec.ts +1 -1
  97. package/tests/cookielawinfo.spec.ts +1 -1
  98. package/tests/cookienotice.spec.ts +1 -1
  99. package/tests/corona-in-zahlen.spec.ts +1 -1
  100. package/tests/deepl.spec.ts +1 -1
  101. package/tests/destatis.spec.ts +1 -1
  102. package/tests/didomi.spec.ts +7 -3
  103. package/tests/drupal.spec.ts +8 -0
  104. package/tests/dunelm.spec.ts +7 -0
  105. package/tests/etsy.spec.ts +1 -1
  106. package/tests/eu-cookie-compliance-banner.spec.ts +1 -1
  107. package/tests/evidon.spec.ts +7 -2
  108. package/tests/fundingchoices.spec.ts +2 -1
  109. package/tests/gov-uk.spec.ts +9 -0
  110. package/tests/hl-co-uk.spec.ts +1 -1
  111. package/tests/hubspot.spec.ts +1 -1
  112. package/tests/ionos.spec.ts +1 -1
  113. package/tests/johnlewis.spec.ts +2 -2
  114. package/tests/klaro.spec.ts +1 -1
  115. package/tests/marksandspencer.spec.ts +7 -0
  116. package/tests/mediamarkt.spec.ts +1 -1
  117. package/tests/metoffice-gov-uk.spec.ts +1 -1
  118. package/tests/microsoft.spec.ts +1 -1
  119. package/tests/moneysavingexpert.spec.ts +1 -1
  120. package/tests/motor-talk.spec.ts +1 -1
  121. package/tests/national-lottery.spec.ts +1 -1
  122. package/tests/netflix.spec.ts +1 -1
  123. package/tests/nhs.spec.ts +1 -1
  124. package/tests/notice-cookie.spec.ts +1 -1
  125. package/tests/obi.spec.ts +1 -1
  126. package/tests/oil.spec.ts +2 -2
  127. package/tests/onetrust.spec.ts +27 -2
  128. package/tests/osano.spec.ts +1 -1
  129. package/tests/otto.spec.ts +1 -1
  130. package/tests/paypal.spec.ts +8 -6
  131. package/tests/quantcast.spec.ts +5 -2
  132. package/tests/snigel.spec.ts +1 -1
  133. package/tests/sourcepoint.spec.ts +8 -8
  134. package/tests/springer.spec.ts +2 -2
  135. package/tests/steampowered.spec.ts +1 -1
  136. package/tests/tealium.spec.ts +1 -1
  137. package/tests/testcmp.spec.ts +1 -1
  138. package/tests/thalia.spec.ts +1 -1
  139. package/tests/thefreedictionary.spec.ts +1 -1
  140. package/tests/trustarc.spec.ts +26 -3
  141. package/tests/usercentrics-1.spec.ts +1 -1
  142. package/tests/uswitch.spec.ts +7 -0
  143. package/tests/vodafone.spec.ts +1 -1
  144. package/tests/waitrose.spec.ts +7 -0
  145. package/tests/wetransfer.spec.ts +7 -0
  146. package/tests/wordpressgdpr.spec.ts +2 -2
  147. package/tests/xing.spec.ts +1 -1
  148. package/tsconfig.json +2 -2
  149. package/update_version.js +10 -6
  150. package/.eslintrc +0 -12
  151. package/cosmetics/rules.json +0 -110
  152. package/dist/autoconsent.puppet.js +0 -1074
  153. package/lib/cmps/all.js +0 -19
  154. package/lib/cmps/base.js +0 -174
  155. package/lib/cmps/consentmanager.js +0 -31
  156. package/lib/cmps/cookiebot.js +0 -73
  157. package/lib/cmps/evidon.js +0 -26
  158. package/lib/cmps/onetrust.js +0 -34
  159. package/lib/cmps/sourcepoint.js +0 -82
  160. package/lib/cmps/sourcepoint.ts +0 -95
  161. package/lib/cmps/trustarc.js +0 -106
  162. package/lib/cmps/trustarc.ts +0 -147
  163. package/lib/config.js +0 -1
  164. package/lib/consentomatic/index.js +0 -52
  165. package/lib/detector.js +0 -33
  166. package/lib/detector.ts +0 -34
  167. package/lib/hider.js +0 -13
  168. package/lib/hider.ts +0 -16
  169. package/lib/index.js +0 -4
  170. package/lib/messages.d.ts +0 -61
  171. package/lib/node.js +0 -35
  172. package/lib/node.ts +0 -43
  173. package/lib/puppet/tab.js +0 -121
  174. package/lib/puppet/tab.ts +0 -146
  175. package/lib/rules.d.ts +0 -80
  176. package/lib/tabwrapper.js +0 -67
  177. package/lib/tabwrapper.ts +0 -74
  178. package/lib/types.d.ts +0 -61
  179. package/lib/web/consentomatic/index.ts +0 -249
  180. package/lib/web/content-utils.js +0 -29
  181. package/lib/web/content-utils.ts +0 -31
  182. package/lib/web/content.js +0 -89
  183. package/lib/web/content.ts +0 -80
  184. package/lib/web/tab.js +0 -112
  185. package/lib/web/tab.ts +0 -178
  186. package/lib/web.js +0 -95
  187. package/tests/runner.ts +0 -61
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "hl.co.uk",
3
- "prehideSelectors": [".cookieModalContent", "#cookie-banner-overlay"],
2
+ "name": "hl.co.uk",
3
+ "prehideSelectors": [".cookieModalContent", "#cookie-banner-overlay"],
4
4
  "detectCmp": [{ "exists": "#cookie-banner-overlay" }],
5
5
  "detectPopup": [{ "exists": "#cookie-banner-overlay" }],
6
6
  "optIn": [{ "click": "#acceptCookieButton" }],
@@ -12,19 +12,18 @@
12
12
  "hide": [".cookieSettingsModal"]
13
13
  },
14
14
  {
15
- "wait": 500
15
+ "waitFor": "#AOCookieToggle"
16
16
  },
17
17
  {
18
- "click": "#AOCookieToggle"
18
+ "click": "#AOCookieToggle[aria-pressed=true]",
19
+ "optional": true
19
20
  },
20
21
  {
21
- "eval": "document.querySelector('#AOCookieToggle').getAttribute('aria-pressed') === 'false'"
22
+ "waitFor": "#TPCookieToggle"
22
23
  },
23
24
  {
24
- "click": "#TPCookieToggle"
25
- },
26
- {
27
- "eval": "document.querySelector('#TPCookieToggle').getAttribute('aria-pressed') === 'false'"
25
+ "click": "#TPCookieToggle[aria-pressed=true]",
26
+ "optional": true
28
27
  },
29
28
  {
30
29
  "click": "#updateCookieButton"
@@ -6,8 +6,11 @@
6
6
  "optOut": [
7
7
  {"click": "button[data-test^=manage-cookies]"},
8
8
  {"wait": "500"},
9
- {"eval": "!!Array.from(document.querySelectorAll('label[data-test^=toggle]')).forEach(e => e.click())", "optional": true },
10
- {"eval": "Array.from(document.querySelectorAll('label[data-test^=toggle]')).filter(e => e.className.match('checked') && !e.className.match('disabled')).length === 0"},
9
+ {
10
+ "click": "label[data-test^=toggle][class*=checked]:not([class*=disabled])",
11
+ "all": true,
12
+ "optional": true
13
+ },
11
14
  {"click": "button[data-test=save-preferences]"}
12
15
  ],
13
16
  "optIn": [{ "click": "button[data-test=allow-all]"}]
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "marksandspencer.com",
3
+ "isHidingRule": true,
4
+ "detectCmp": [{ "exists": ".navigation-cookiebbanner" }],
5
+ "detectPopup": [{ "visible": ".navigation-cookiebbanner" }],
6
+ "optOut": [{ "hide": [".navigation-cookiebbanner"]}],
7
+ "optIn": [{ "click": [".navigation-cookiebbanner__submit"]}]
8
+ }
@@ -7,5 +7,5 @@
7
7
  "detectCmp": [{"exists": "div[aria-labelledby^=pwa-consent-layer-title]"}],
8
8
  "detectPopup": [{"exists": "div[aria-labelledby^=pwa-consent-layer-title]"}],
9
9
  "optOut": [{"click": "button[data-test^=pwa-consent-layer-deny-all]"}],
10
- "optIn": [{"click": "'button[data-test^=pwa-consent-layer-accept-all'"}]
10
+ "optIn": [{"click": "button[data-test^=pwa-consent-layer-accept-all"}]
11
11
  }
@@ -4,6 +4,6 @@
4
4
  "detectCmp": [{ "exists": "#wcpConsentBannerCtrl" }],
5
5
  "detectPopup": [{ "exists": "#wcpConsentBannerCtrl" }],
6
6
  "optOut": [{ "eval": "Array.from(document.querySelectorAll('div > button')).filter(el => el.innerText.match('Reject|Ablehnen'))[0].click() || true" }],
7
- "optIn": [{ "eval": "Array.from(document.querySelectorAll('div > button')).filter(el => el.innerText.match('Accept|Annehmen'))[0].click()" }],
7
+ "optIn": [{ "eval": "Array.from(document.querySelectorAll('div > button')).filter(el => el.innerText.match('Accept|Annehmen'))[0].click() || true" }],
8
8
  "test": [{ "eval": "!!document.cookie.match('MSCC')"}]
9
9
  }
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "notice-cookie",
3
3
  "prehideSelectors": [".button--notice"],
4
- "isHidingRule": true,
5
4
  "detectCmp": [{ "exists": ".notice--cookie" }],
6
5
  "detectPopup": [{ "visible": ".notice--cookie" }],
7
6
  "optIn": [{ "click": ".button--notice" }],
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "osano",
3
3
  "prehideSelectors": [".osano-cm-window"],
4
- "isHidingRule": true,
5
4
  "detectCmp": [{ "exists": ".osano-cm-window" }],
6
5
  "detectPopup": [{ "visible": ".osano-cm-dialog" }],
7
- "optIn": [{ "click": ".osano-cm-accept-all" }],
6
+ "optIn": [{
7
+ "click": ".osano-cm-accept-all",
8
+ "optional": true
9
+ }],
8
10
  "optOut": [
9
11
  { "hide": [".osano-cm-window"] }
10
12
  ]
@@ -1,12 +1,16 @@
1
1
  {
2
- "name": "paypal.de",
2
+ "name": "paypal.com",
3
3
  "prehideSelectors": ["#gdprCookieBanner"],
4
4
  "detectCmp": [{ "exists": "#gdprCookieBanner"}],
5
5
  "detectPopup": [{ "visible": "#gdprCookieContent_wrapper" }],
6
6
  "optIn": [{ "click": "#acceptAllButton" }],
7
7
  "optOut": [
8
+ {
9
+ "wait": 200
10
+ },
8
11
  {
9
12
  "click": ".gdprCookieBanner_decline-button"
10
13
  }
11
- ]
14
+ ],
15
+ "test": [{"eval": "document.cookie.includes('cookie_prefs') === true"}]
12
16
  }
@@ -3,5 +3,6 @@
3
3
  "detectCmp": [{ "exists": ".snigel-cmp-framework" }],
4
4
  "detectPopup": [{ "visible": ".snigel-cmp-framework" }],
5
5
  "optOut": [{ "click": "#sn-b-custom" }, {"click": "#sn-b-save"}],
6
- "test": [{ "eval": "!!document.cookie.match('snconsent')"}]
6
+ "test": [{ "eval": "!!document.cookie.match('snconsent')"}],
7
+ "optIn": [{ "click": ".snigel-cmp-framework #accept-choices" }]
7
8
  }
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "Tealium",
3
3
  "prehideSelectors": ["#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#consent-layer"],
4
- "isHidingRule": false,
5
- "detectCmp": [{ "exists": "#__tealiumGDPRecModal" }, { "eval": "window.utag && typeof utag.gdpr === 'object'" }],
4
+ "detectCmp": [{ "visible": "#__tealiumGDPRecModal" }, { "eval": "typeof window.utag !== 'undefined' && typeof utag.gdpr === 'object'" }],
6
5
  "detectPopup": [{ "visible": "#__tealiumGDPRecModal" }],
7
6
  "optOut": [
8
7
  { "hide": ["#__tealiumGDPRecModal", "#__tealiumGDPRcpPrefs", "#consent-layer"] },
9
- { "click": "#cm-acceptNone,.js-accept-essential-cookies"}
8
+ { "waitForThenClick": "#cm-acceptNone,.js-accept-essential-cookies", "timeout": 1000 },
9
+ { "eval": "utag.gdpr.setConsentValue(false) || true" }
10
10
  ],
11
11
  "optIn": [
12
12
  { "hide": ["#__tealiumGDPRecModal"] },
13
- { "eval": "utag.gdpr.setConsentValue(true)" }
13
+ { "eval": "utag.gdpr.setConsentValue(true) || true" }
14
14
  ],
15
15
  "test": [
16
16
  { "eval": "utag.gdpr.getConsentState() !== 1" }
17
17
  ]
18
18
  }
19
-
@@ -3,7 +3,7 @@
3
3
  "prehideSelectors": ["#cmpBanner"],
4
4
  "detectCmp": [{ "exists": "#cmpBanner" }],
5
5
  "detectPopup": [{ "visible": "#cmpBanner" }],
6
- "optIn": [{ "eval": "cmpUi.allowAll()" }],
6
+ "optIn": [{ "eval": "cmpUi.allowAll() || true" }],
7
7
  "optOut": [
8
8
  {
9
9
  "eval": "cmpUi.showPurposes() || cmpUi.rejectAll() || true"
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "uswitch.com",
3
+ "prehideSelectors": ["#cookie-banner-wrapper"],
4
+ "detectCmp": [{ "exists": "#cookie-banner-wrapper"}],
5
+ "detectPopup": [{ "visible": "#cookie-banner-wrapper" }],
6
+ "optIn": [{ "click": "#cookie_banner_accept_mobile" }],
7
+ "optOut": [{ "click": "#cookie_banner_save"}]
8
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "waitrose.com",
3
+ "prehideSelectors": [
4
+ "div[aria-labelledby=CookieAlertModalHeading]",
5
+ "section[data-test=initial-waitrose-cookie-consent-banner]",
6
+ "section[data-test=cookie-consent-modal]"
7
+ ],
8
+ "detectCmp": [{ "exists": "section[data-test=initial-waitrose-cookie-consent-banner]"}],
9
+ "detectPopup": [{ "visible": "section[data-test=initial-waitrose-cookie-consent-banner]" }],
10
+ "optIn": [{ "click": "button[data-test=accept-all]" }],
11
+ "optOut": [
12
+ {
13
+ "click": "button[data-test=manage-cookies]"
14
+ },
15
+ {
16
+ "wait": 200
17
+ },
18
+ {
19
+ "eval": "Array.from(document.querySelectorAll('label[id$=cookies-deny-label]')).forEach(e => e.click()) || true"
20
+ },
21
+ {
22
+ "click": "button[data-test=submit]"
23
+ }
24
+ ],
25
+ "test": [
26
+ {"eval": "document.cookie.includes('wtr_cookies_advertising=0') && document.cookie.includes('wtr_cookies_analytics=0')"}
27
+ ]
28
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "wetransfer.com",
3
+ "detectCmp": [{ "exists": ".welcome__cookie-notice"}],
4
+ "detectPopup": [{ "visible": ".welcome__cookie-notice" }],
5
+ "optIn": [{ "click": ".welcome__button--accept" }],
6
+ "optOut": [{ "click": ".welcome__button--decline"}]
7
+ }