@duckduckgo/autoconsent 3.0.4 → 4.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 (183) hide show
  1. package/.eslintrc +21 -0
  2. package/.github/ISSUE_TEMPLATE/broken-site-issue.md +29 -0
  3. package/.github/dependabot.yml +6 -0
  4. package/.github/workflows/checks.yml +19 -0
  5. package/.prettierrc +4 -0
  6. package/CHANGELOG.md +65 -0
  7. package/Jenkinsfile +4 -4
  8. package/api.md +10 -1
  9. package/dist/addon-firefox/background.bundle.js +312 -1
  10. package/dist/addon-firefox/content.bundle.js +1912 -1
  11. package/dist/addon-firefox/manifest.json +2 -2
  12. package/dist/addon-firefox/rules.json +183 -42
  13. package/dist/addon-mv3/background.bundle.js +312 -1
  14. package/dist/addon-mv3/content.bundle.js +1912 -1
  15. package/dist/addon-mv3/devtools/background.html +10 -0
  16. package/dist/addon-mv3/devtools/bulma.min.css +1 -0
  17. package/dist/addon-mv3/devtools/loader.js +2 -0
  18. package/dist/addon-mv3/devtools/panel.html +88 -0
  19. package/dist/addon-mv3/devtools/panel.js +148 -0
  20. package/dist/addon-mv3/devtools/panel.ts +145 -0
  21. package/dist/addon-mv3/manifest.json +5 -3
  22. package/dist/addon-mv3/popup.bundle.js +173 -1
  23. package/dist/addon-mv3/popup.html +14 -0
  24. package/dist/addon-mv3/rules.json +183 -42
  25. package/dist/autoconsent.cjs.js +1 -1
  26. package/dist/autoconsent.esm.js +1 -1
  27. package/dist/autoconsent.playwright.js +1 -1
  28. package/lib/cmps/airbnb.ts +4 -0
  29. package/lib/cmps/base.ts +8 -0
  30. package/lib/cmps/consentmanager.ts +4 -0
  31. package/lib/cmps/consentomatic.ts +1 -0
  32. package/lib/cmps/conversant.ts +4 -0
  33. package/lib/cmps/cookiebot.ts +4 -0
  34. package/lib/cmps/evidon.ts +4 -0
  35. package/lib/cmps/klaro.ts +4 -0
  36. package/lib/cmps/onetrust.ts +4 -0
  37. package/lib/cmps/sourcepoint-frame.ts +35 -7
  38. package/lib/cmps/tiktok.ts +4 -0
  39. package/lib/cmps/trustarc-frame.ts +4 -0
  40. package/lib/cmps/trustarc-top.ts +4 -0
  41. package/lib/cmps/uniconsent.ts +4 -0
  42. package/lib/consentomatic/index.ts +12 -12
  43. package/lib/consentomatic/tools.ts +13 -13
  44. package/lib/eval-handler.ts +2 -6
  45. package/lib/messages.ts +44 -13
  46. package/lib/random.ts +6 -0
  47. package/lib/rule-executors.ts +8 -3
  48. package/lib/rules.ts +2 -1
  49. package/lib/types.ts +27 -0
  50. package/lib/web.ts +127 -82
  51. package/package.json +11 -8
  52. package/playwright/runner.ts +1 -0
  53. package/rollup.config.js +18 -5
  54. package/rules/autoconsent/affinity-serif-com.json +1 -4
  55. package/rules/autoconsent/ausopen.json +2 -2
  56. package/rules/autoconsent/baden-wuerttemberg-de.json +1 -0
  57. package/rules/autoconsent/cc-banner.json +1 -0
  58. package/rules/autoconsent/complianz-notice.json +1 -0
  59. package/rules/autoconsent/cookie-notice.json +2 -1
  60. package/rules/autoconsent/cookiealert.json +48 -0
  61. package/rules/autoconsent/dsgvo.json +1 -0
  62. package/rules/autoconsent/eu-cookie-compliance.json +1 -1
  63. package/rules/autoconsent/eu-cookie-law.json +1 -0
  64. package/rules/autoconsent/ezoic.json +1 -0
  65. package/rules/autoconsent/generic-cosmetic.json +9 -0
  66. package/rules/autoconsent/indeed-com.json +9 -0
  67. package/rules/autoconsent/jquery-cookiebar.json +1 -0
  68. package/rules/autoconsent/marksandspencer.json +2 -2
  69. package/rules/autoconsent/notice-cookie.json +1 -0
  70. package/rules/autoconsent/osano.json +1 -0
  71. package/rules/autoconsent/pornhub.json +12 -0
  72. package/rules/autoconsent/uk-cookie-consent.json +1 -0
  73. package/rules/autoconsent/xnxx-com.json +9 -0
  74. package/rules/rules.json +183 -42
  75. package/tests/192.spec.ts +3 -3
  76. package/tests/adroll.spec.ts +7 -7
  77. package/tests/affinity-serif-com.spec.ts +1 -1
  78. package/tests/airbnb.spec.ts +3 -3
  79. package/tests/amazon.spec.ts +8 -8
  80. package/tests/arzt-auskunft.spec.ts +3 -3
  81. package/tests/ausopen.spec.ts +2 -2
  82. package/tests/aws.amazon.spec.ts +3 -3
  83. package/tests/axeptio.spec.ts +3 -3
  84. package/tests/baden-wuerttemberg.spec.ts +3 -3
  85. package/tests/borlabs.spec.ts +4 -4
  86. package/tests/bundesregierung.spec.ts +6 -6
  87. package/tests/ccbanner.spec.ts +4 -4
  88. package/tests/clickio.spec.ts +5 -5
  89. package/tests/complianz-banner.spec.ts +2 -2
  90. package/tests/complianz-categories.spec.ts +5 -5
  91. package/tests/complianz-notice.spec.ts +3 -3
  92. package/tests/complianz-optin.spec.ts +4 -4
  93. package/tests/consentmanager.spec.ts +8 -8
  94. package/tests/conversant.spec.ts +5 -5
  95. package/tests/cookie-notice.spec.ts +5 -3
  96. package/tests/cookiealert.spec.ts +9 -0
  97. package/tests/cookiebot.spec.ts +7 -11
  98. package/tests/cookieinformation.spec.ts +4 -5
  99. package/tests/cookielawinfo.spec.ts +3 -3
  100. package/tests/corona-in-zahlen.spec.ts +3 -3
  101. package/tests/dailymotion.spec.ts +5 -5
  102. package/tests/deepl.spec.ts +3 -3
  103. package/tests/didomi.spec.ts +8 -8
  104. package/tests/dmgmedia.spec.ts +7 -7
  105. package/tests/drupal.spec.ts +3 -3
  106. package/tests/dsgvo.spec.ts +4 -1
  107. package/tests/dunelm.spec.ts +3 -3
  108. package/tests/etsy.spec.ts +2 -2
  109. package/tests/eu-cookie-compliance-banner.spec.ts +2 -2
  110. package/tests/eu-cookie-law.spec.ts +2 -2
  111. package/tests/evidon.spec.ts +4 -6
  112. package/tests/ezoic.spec.ts +2 -3
  113. package/tests/facebook.spec.ts +5 -5
  114. package/tests/fundingchoices.spec.ts +5 -6
  115. package/tests/generic-cosmetic.spec.ts +11 -0
  116. package/tests/google.spec.ts +2 -2
  117. package/tests/gov-uk.spec.ts +4 -4
  118. package/tests/hl-co-uk.spec.ts +3 -3
  119. package/tests/hubspot.spec.ts +2 -2
  120. package/tests/indeed.spec.ts +7 -0
  121. package/tests/ionos.spec.ts +3 -3
  122. package/tests/iubenda.spec.ts +3 -3
  123. package/tests/johnlewis.spec.ts +3 -3
  124. package/tests/jquery-cookiebar.spec.ts +2 -2
  125. package/tests/klaro.spec.ts +5 -5
  126. package/tests/linkedin.spec.ts +2 -2
  127. package/tests/marksandspencer.spec.ts +2 -2
  128. package/tests/mediamarkt.spec.ts +3 -3
  129. package/tests/mediavine.spec.ts +3 -3
  130. package/tests/metoffice-gov-uk.spec.ts +3 -3
  131. package/tests/microsoft.spec.ts +4 -4
  132. package/tests/moneysavingexpert.spec.ts +3 -3
  133. package/tests/monzo-com.spec.ts +1 -1
  134. package/tests/moove.spec.ts +4 -10
  135. package/tests/national-lottery.spec.ts +3 -3
  136. package/tests/netflix.spec.ts +3 -3
  137. package/tests/nhs.spec.ts +3 -3
  138. package/tests/notice-cookie.spec.ts +2 -2
  139. package/tests/obi.spec.ts +3 -3
  140. package/tests/oil.spec.ts +6 -6
  141. package/tests/onetrust.spec.ts +24 -24
  142. package/tests/osano.spec.ts +1 -1
  143. package/tests/otto.spec.ts +3 -3
  144. package/tests/paypal.spec.ts +4 -4
  145. package/tests/pornhub.spec.ts +7 -0
  146. package/tests/primebox.spec.ts +2 -2
  147. package/tests/privacymanager.spec.ts +3 -3
  148. package/tests/pubtech.spec.ts +8 -9
  149. package/tests/quantcast.spec.ts +10 -10
  150. package/tests/reddit.spec.ts +3 -3
  151. package/tests/sibbo.spec.ts +9 -10
  152. package/tests/sirdata.spec.ts +2 -3
  153. package/tests/snigel.spec.ts +3 -3
  154. package/tests/sourcepoint.spec.ts +17 -17
  155. package/tests/springer.spec.ts +6 -6
  156. package/tests/steampowered.spec.ts +3 -3
  157. package/tests/tarteaucitron.spec.ts +4 -4
  158. package/tests/tealium.spec.ts +2 -2
  159. package/tests/termly.spec.ts +4 -4
  160. package/tests/testcmp.spec.ts +1 -1
  161. package/tests/thalia.spec.ts +3 -3
  162. package/tests/thefreedictionary.spec.ts +3 -3
  163. package/tests/tiktok.spec.ts +5 -5
  164. package/tests/trustarc.spec.ts +13 -15
  165. package/tests/twitter.spec.ts +7 -7
  166. package/tests/uk-cookie-consent.spec.ts +3 -3
  167. package/tests/uniconsent.spec.ts +4 -4
  168. package/tests/usercentrics-api.spec.ts +6 -5
  169. package/tests/usercentrics-button.spec.ts +2 -3
  170. package/tests/uswitch.spec.ts +3 -3
  171. package/tests/vodafone.spec.ts +3 -3
  172. package/tests/waitrose.spec.ts +3 -3
  173. package/tests/wetransfer.spec.ts +3 -3
  174. package/tests/wordpressgdpr.spec.ts +3 -3
  175. package/tests/wp-cookie-notice.spec.ts +3 -3
  176. package/tests/xing.spec.ts +4 -4
  177. package/tests/xnxx.spec.ts +8 -0
  178. package/tests/youtube-desktop.spec.ts +2 -4
  179. package/tests/youtube-mobile.spec.ts +3 -3
  180. package/tsconfig.json +2 -1
  181. package/.eslintrc.cjs +0 -14
  182. package/rules/autoconsent/motor-talk-de.json +0 -24
  183. package/tests/motor-talk.spec.ts +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 2,
3
3
  "name": "Autoconsent",
4
- "version": "2022.11.18",
4
+ "version": "2022.12.14",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"
@@ -29,4 +29,4 @@
29
29
  "browser_style": true,
30
30
  "default_title": "Autoconsent"
31
31
  }
32
- }
32
+ }
@@ -66,10 +66,7 @@
66
66
  "name": "affinity.serif.com",
67
67
  "detectCmp": [
68
68
  {
69
- "exists": ".c-cookie-banner"
70
- },
71
- {
72
- "exists": ".c-cookie-banner button"
69
+ "exists": ".c-cookie-banner button[data-qa='allow-all-cookies']"
73
70
  }
74
71
  ],
75
72
  "detectPopup": [
@@ -172,7 +169,7 @@
172
169
  },
173
170
  {
174
171
  "name": "ausopen.com",
175
- "isHidingRule": true,
172
+ "cosmetic": true,
176
173
  "detectCmp": [
177
174
  {
178
175
  "exists": ".gdpr-popup__message"
@@ -192,9 +189,7 @@
192
189
  ],
193
190
  "optIn": [
194
191
  {
195
- "click": [
196
- ".gdpr-popup__message button"
197
- ]
192
+ "click": ".gdpr-popup__message button"
198
193
  }
199
194
  ]
200
195
  },
@@ -280,6 +275,7 @@
280
275
  "prehideSelectors": [
281
276
  ".cookie-alert.t-dark"
282
277
  ],
278
+ "cosmetic": true,
283
279
  "detectCmp": [
284
280
  {
285
281
  "exists": ".cookie-alert.t-dark"
@@ -422,6 +418,7 @@
422
418
  },
423
419
  {
424
420
  "name": "cc_banner",
421
+ "cosmetic": true,
425
422
  "prehideSelectors": [
426
423
  ".cc_banner-wrapper"
427
424
  ],
@@ -573,6 +570,7 @@
573
570
  "prehideSelectors": [
574
571
  ".cc-type-info[aria-describedby=\"cookieconsent:desc\"]"
575
572
  ],
573
+ "cosmetic": true,
576
574
  "detectCmp": [
577
575
  {
578
576
  "exists": ".cc-type-info[aria-describedby=\"cookieconsent:desc\"]"
@@ -696,6 +694,7 @@
696
694
  "prehideSelectors": [
697
695
  "#cookie-notice"
698
696
  ],
697
+ "cosmetic": true,
699
698
  "detectCmp": [
700
699
  {
701
700
  "visible": "#cookie-notice .cookie-notice-container"
@@ -708,9 +707,7 @@
708
707
  ],
709
708
  "optIn": [
710
709
  {
711
- "click": [
712
- "#cn-accept-cookie"
713
- ]
710
+ "click": "#cn-accept-cookie"
714
711
  }
715
712
  ],
716
713
  "optOut": [
@@ -721,6 +718,54 @@
721
718
  }
722
719
  ]
723
720
  },
721
+ {
722
+ "name": "cookiealert",
723
+ "intermediate": false,
724
+ "prehideSelectors": [],
725
+ "runContext": {
726
+ "frame": true,
727
+ "main": true
728
+ },
729
+ "detectCmp": [
730
+ {
731
+ "exists": ".cookie-alert-extended"
732
+ }
733
+ ],
734
+ "detectPopup": [
735
+ {
736
+ "visible": ".cookie-alert-extended-modal"
737
+ }
738
+ ],
739
+ "optIn": [
740
+ {
741
+ "click": "button[data-controller='cookie-alert/extended/button/accept']"
742
+ },
743
+ {
744
+ "eval": "document.querySelector('body').removeAttribute('style') || true"
745
+ }
746
+ ],
747
+ "optOut": [
748
+ {
749
+ "click": "a[data-controller='cookie-alert/extended/detail-link']"
750
+ },
751
+ {
752
+ "click": ".cookie-alert-configuration-input:checked",
753
+ "all": true,
754
+ "optional": true
755
+ },
756
+ {
757
+ "click": "button[data-controller='cookie-alert/extended/button/configuration']"
758
+ },
759
+ {
760
+ "eval": "document.querySelector('body').removeAttribute('style') || true"
761
+ }
762
+ ],
763
+ "test": [
764
+ {
765
+ "eval": "window.CookieConsent.declined === true"
766
+ }
767
+ ]
768
+ },
724
769
  {
725
770
  "name": "Cookie Information Banner",
726
771
  "prehideSelectors": [
@@ -912,6 +957,7 @@
912
957
  "prehideSelectors": [
913
958
  ".sp-dsgvo"
914
959
  ],
960
+ "cosmetic": true,
915
961
  "detectCmp": [
916
962
  {
917
963
  "exists": ".sp-dsgvo.sp-dsgvo-popup-overlay"
@@ -1025,7 +1071,7 @@
1025
1071
  ],
1026
1072
  "detectPopup": [
1027
1073
  {
1028
- "visible": ".eu-cookie-compliance-banner-info"
1074
+ "exists": ".eu-cookie-compliance-popup-open"
1029
1075
  }
1030
1076
  ],
1031
1077
  "optIn": [
@@ -1056,6 +1102,7 @@
1056
1102
  "prehideSelectors": [
1057
1103
  ".pea_cook_wrapper,.pea_cook_more_info_popover"
1058
1104
  ],
1105
+ "cosmetic": true,
1059
1106
  "detectCmp": [
1060
1107
  {
1061
1108
  "exists": ".pea_cook_wrapper"
@@ -1113,6 +1160,9 @@
1113
1160
  }
1114
1161
  ],
1115
1162
  "optOut": [
1163
+ {
1164
+ "wait": 500
1165
+ },
1116
1166
  {
1117
1167
  "click": "#ez-manage-settings"
1118
1168
  },
@@ -1205,6 +1255,31 @@
1205
1255
  }
1206
1256
  ]
1207
1257
  },
1258
+ {
1259
+ "name": "generic-cosmetic",
1260
+ "cosmetic": true,
1261
+ "prehideSelectors": [
1262
+ "#js-cookie-banner,.js-cookie-banner,.cookie-banner,#cookie-banner"
1263
+ ],
1264
+ "detectCmp": [
1265
+ {
1266
+ "exists": "#js-cookie-banner,.js-cookie-banner,.cookie-banner,#cookie-banner"
1267
+ }
1268
+ ],
1269
+ "detectPopup": [
1270
+ {
1271
+ "visible": "#js-cookie-banner,.js-cookie-banner,.cookie-banner,#cookie-banner"
1272
+ }
1273
+ ],
1274
+ "optIn": [],
1275
+ "optOut": [
1276
+ {
1277
+ "hide": [
1278
+ "#js-cookie-banner,.js-cookie-banner,.cookie-banner,#cookie-banner"
1279
+ ]
1280
+ }
1281
+ ]
1282
+ },
1208
1283
  {
1209
1284
  "name": "google-consent-standalone",
1210
1285
  "prehideSelectors": [],
@@ -1364,6 +1439,35 @@
1364
1439
  }
1365
1440
  ]
1366
1441
  },
1442
+ {
1443
+ "name": "indeed.com",
1444
+ "cosmetic": true,
1445
+ "prehideSelectors": [
1446
+ "#CookiePrivacyNotice"
1447
+ ],
1448
+ "detectCmp": [
1449
+ {
1450
+ "exists": "#CookiePrivacyNotice"
1451
+ }
1452
+ ],
1453
+ "detectPopup": [
1454
+ {
1455
+ "visible": "#CookiePrivacyNotice"
1456
+ }
1457
+ ],
1458
+ "optIn": [
1459
+ {
1460
+ "click": "#CookiePrivacyNotice button[data-gnav-element-name=CookiePrivacyNoticeOk]"
1461
+ }
1462
+ ],
1463
+ "optOut": [
1464
+ {
1465
+ "hide": [
1466
+ "#CookiePrivacyNotice"
1467
+ ]
1468
+ }
1469
+ ]
1470
+ },
1367
1471
  {
1368
1472
  "name": "ionos.de",
1369
1473
  "prehideSelectors": [
@@ -1474,6 +1578,7 @@
1474
1578
  "prehideSelectors": [
1475
1579
  ".cookie-bar"
1476
1580
  ],
1581
+ "cosmetic": true,
1477
1582
  "detectCmp": [
1478
1583
  {
1479
1584
  "exists": ".cookie-bar .cookie-bar__message,.cookie-bar .cookie-bar__buttons"
@@ -1553,7 +1658,7 @@
1553
1658
  },
1554
1659
  {
1555
1660
  "name": "marksandspencer.com",
1556
- "isHidingRule": true,
1661
+ "cosmetic": true,
1557
1662
  "detectCmp": [
1558
1663
  {
1559
1664
  "exists": ".navigation-cookiebbanner"
@@ -1573,9 +1678,7 @@
1573
1678
  ],
1574
1679
  "optIn": [
1575
1680
  {
1576
- "click": [
1577
- ".navigation-cookiebbanner__submit"
1578
- ]
1681
+ "click": ".navigation-cookiebbanner__submit"
1579
1682
  }
1580
1683
  ]
1581
1684
  },
@@ -1812,32 +1915,6 @@
1812
1915
  }
1813
1916
  ]
1814
1917
  },
1815
- {
1816
- "name": "motor-talk.de",
1817
- "prehideSelectors": [
1818
- ".mt-cc-bnnr__wrapper"
1819
- ],
1820
- "detectCmp": [
1821
- {
1822
- "exists": ".mt-cc-bnnr"
1823
- }
1824
- ],
1825
- "detectPopup": [
1826
- {
1827
- "visible": ".mt-cc-bnnr__wrapper"
1828
- }
1829
- ],
1830
- "optIn": [
1831
- {
1832
- "click": ".mt-cc-bnnr__button-main"
1833
- }
1834
- ],
1835
- "optOut": [
1836
- {
1837
- "click": ".mt-cc-bnnr__decline-link"
1838
- }
1839
- ]
1840
- },
1841
1918
  {
1842
1919
  "name": "national-lottery.co.uk",
1843
1920
  "detectCmp": [
@@ -1928,6 +2005,7 @@
1928
2005
  "prehideSelectors": [
1929
2006
  ".button--notice"
1930
2007
  ],
2008
+ "cosmetic": true,
1931
2009
  "detectCmp": [
1932
2010
  {
1933
2011
  "exists": ".notice--cookie"
@@ -1982,6 +2060,7 @@
1982
2060
  "prehideSelectors": [
1983
2061
  ".osano-cm-window"
1984
2062
  ],
2063
+ "cosmetic": true,
1985
2064
  "detectCmp": [
1986
2065
  {
1987
2066
  "exists": ".osano-cm-window"
@@ -2069,6 +2148,38 @@
2069
2148
  }
2070
2149
  ]
2071
2150
  },
2151
+ {
2152
+ "name": "pornhub.com",
2153
+ "runContext": {
2154
+ "urlPattern": "^https://(www\\.)?pornhub\\.com/"
2155
+ },
2156
+ "cosmetic": true,
2157
+ "prehideSelectors": [
2158
+ ".cookiesBanner"
2159
+ ],
2160
+ "detectCmp": [
2161
+ {
2162
+ "exists": ".cookiesBanner"
2163
+ }
2164
+ ],
2165
+ "detectPopup": [
2166
+ {
2167
+ "visible": ".cookiesBanner"
2168
+ }
2169
+ ],
2170
+ "optIn": [
2171
+ {
2172
+ "click": ".cookiesBanner .okButton"
2173
+ }
2174
+ ],
2175
+ "optOut": [
2176
+ {
2177
+ "hide": [
2178
+ ".cookiesBanner"
2179
+ ]
2180
+ }
2181
+ ]
2182
+ },
2072
2183
  {
2073
2184
  "name": "PrimeBox CookieBar",
2074
2185
  "prehideSelectors": [
@@ -2704,6 +2815,7 @@
2704
2815
  "prehideSelectors": [
2705
2816
  "#catapult-cookie-bar"
2706
2817
  ],
2818
+ "cosmetic": true,
2707
2819
  "detectCmp": [
2708
2820
  {
2709
2821
  "exists": "#catapult-cookie-bar"
@@ -2980,6 +3092,35 @@
2980
3092
  }
2981
3093
  ]
2982
3094
  },
3095
+ {
3096
+ "name": "xnxx-com",
3097
+ "cosmetic": true,
3098
+ "prehideSelectors": [
3099
+ "#cookies-use-alert"
3100
+ ],
3101
+ "detectCmp": [
3102
+ {
3103
+ "exists": "#cookies-use-alert"
3104
+ }
3105
+ ],
3106
+ "detectPopup": [
3107
+ {
3108
+ "visible": "#cookies-use-alert"
3109
+ }
3110
+ ],
3111
+ "optIn": [
3112
+ {
3113
+ "click": "#cookies-use-alert .close"
3114
+ }
3115
+ ],
3116
+ "optOut": [
3117
+ {
3118
+ "hide": [
3119
+ "#cookies-use-alert"
3120
+ ]
3121
+ }
3122
+ ]
3123
+ },
2983
3124
  {
2984
3125
  "name": "youtube-desktop",
2985
3126
  "prehideSelectors": [