@duckduckgo/autoconsent 17.4.0 → 18.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 (102) hide show
  1. package/.github/workflows/ddg-release.yml +6 -3
  2. package/.prettierignore +1 -0
  3. package/AGENTS.md +2 -0
  4. package/CHANGELOG.md +57 -0
  5. package/dist/addon-firefox/background.bundle.js +4 -1
  6. package/dist/addon-firefox/compact-rules.json +1 -1
  7. package/dist/addon-firefox/content.bundle.js +608 -61
  8. package/dist/addon-firefox/manifest.json +1 -1
  9. package/dist/addon-firefox/rule-index.json +1 -1
  10. package/dist/addon-firefox/rules.json +1 -1
  11. package/dist/addon-mv3/background.bundle.js +4 -1
  12. package/dist/addon-mv3/compact-rules.json +1 -1
  13. package/dist/addon-mv3/content.bundle.js +608 -61
  14. package/dist/addon-mv3/manifest.json +1 -1
  15. package/dist/addon-mv3/rule-index.json +1 -1
  16. package/dist/addon-mv3/rules.json +1 -1
  17. package/dist/autoconsent.cjs.js +614 -67
  18. package/dist/autoconsent.esm.js +614 -67
  19. package/dist/autoconsent.playwright.js +608 -61
  20. package/dist/autoconsent.standalone.js +615 -68
  21. package/dist/heuristics.cjs.js +621 -52
  22. package/dist/heuristics.mjs +609 -50
  23. package/dist/types/cmps/tiktok.d.ts +0 -2
  24. package/dist/types/eval-snippets.d.ts +2 -0
  25. package/dist/types/heuristic-classify.d.ts +2 -6
  26. package/dist/types/heuristic-detect.d.ts +32 -0
  27. package/dist/types/heuristic-literals.d.ts +1 -0
  28. package/dist/types/heuristic-negatives.d.ts +25 -0
  29. package/dist/types/heuristic-patterns.d.ts +18 -2
  30. package/dist/types/heuristic-prefilter.d.ts +13 -0
  31. package/docs/heuristic-detection.md +78 -0
  32. package/docs/heuristic-prefilter.md +62 -0
  33. package/eslint.config.mjs +16 -1
  34. package/lib/cmps/evidon.ts +5 -4
  35. package/lib/cmps/tiktok.ts +0 -5
  36. package/lib/eval-snippets.ts +3 -0
  37. package/lib/heuristic-classify.ts +4 -39
  38. package/lib/heuristic-detect.ts +209 -0
  39. package/lib/heuristic-literals.ts +207 -0
  40. package/lib/heuristic-negatives.ts +173 -0
  41. package/lib/heuristic-patterns.ts +104 -31
  42. package/lib/heuristic-prefilter.ts +40 -0
  43. package/lib/heuristics.ts +8 -4
  44. package/lib/web.ts +1 -1
  45. package/package.json +2 -1
  46. package/rules/autoconsent/binogi.json +32 -0
  47. package/rules/autoconsent/bokio.json +32 -0
  48. package/rules/autoconsent/botble-cookie-consent.json +16 -0
  49. package/rules/autoconsent/calcolo-tools.json +23 -0
  50. package/rules/autoconsent/consilium-europa-eu.json +35 -0
  51. package/rules/autoconsent/dtu-findit.json +47 -0
  52. package/rules/autoconsent/hikvision.com.json +18 -0
  53. package/rules/autoconsent/hmgroup-turbocookie.json +18 -0
  54. package/rules/autoconsent/hmrc-tracking-consent.json +40 -0
  55. package/rules/autoconsent/hurra-consent.json +16 -0
  56. package/rules/autoconsent/isidewith.com.json +38 -0
  57. package/rules/autoconsent/landgate.json +10 -0
  58. package/rules/autoconsent/meta-cookie-dialog-v2.json +40 -0
  59. package/rules/autoconsent/pakamera.json +19 -0
  60. package/rules/autoconsent/purecookie-cosmetic.json +13 -0
  61. package/rules/autoconsent/random-org.json +41 -0
  62. package/rules/autoconsent/reverb-gdpr-nag.json +18 -0
  63. package/rules/autoconsent/reverb.json +24 -0
  64. package/rules/autoconsent/tallink.json +13 -0
  65. package/rules/autoconsent/tealium.json +4 -1
  66. package/rules/autoconsent/typo3-cookieconsent.json +9 -0
  67. package/rules/autoconsent/vinnies-org-au.json +29 -0
  68. package/rules/autoconsent/zoho.json +23 -0
  69. package/rules/compact-rules.json +1 -1
  70. package/rules/rule-index.json +1 -1
  71. package/rules/rules.json +1 -1
  72. package/scripts/build-heuristic-literals.ts +24 -0
  73. package/scripts/required-literals.ts +177 -0
  74. package/tests/binogi.spec.ts +3 -0
  75. package/tests/bokio.spec.ts +6 -0
  76. package/tests/botble-cookie-consent.spec.ts +11 -0
  77. package/tests/calcolo-tools.spec.ts +3 -0
  78. package/tests/consilium-europa-eu.spec.ts +3 -0
  79. package/tests/dtu-findit.spec.ts +3 -0
  80. package/tests/evidon.spec.ts +2 -1
  81. package/tests/hikvision.com.spec.ts +3 -0
  82. package/tests/hmgroup-turbocookie.spec.ts +7 -0
  83. package/tests/hmrc-tracking-consent.spec.ts +7 -0
  84. package/tests/hurra-consent.spec.ts +8 -0
  85. package/tests/isidewith.com.spec.ts +3 -0
  86. package/tests/landgate.spec.ts +3 -0
  87. package/tests/meta-cookie-dialog-v2.spec.ts +10 -0
  88. package/tests/pakamera.spec.ts +5 -0
  89. package/tests/purecookie-cosmetic.spec.ts +8 -0
  90. package/tests/random-org.spec.ts +3 -0
  91. package/tests/reverb.spec.ts +7 -0
  92. package/tests/tallink.spec.ts +3 -0
  93. package/tests/tiktok.spec.ts +2 -2
  94. package/tests/typo3-cookieconsent.spec.ts +10 -0
  95. package/tests/vinnies-org-au.spec.ts +3 -0
  96. package/tests/zoho.spec.ts +5 -0
  97. package/tests-wtr/heuristics/heuristics-utils.test.ts +222 -8
  98. package/tests-wtr/heuristics/regex-syntax.test.ts +81 -0
  99. package/rules/generated/auto_GB_capcut.com_0.json +0 -28
  100. package/rules/generated/auto_NL_bonprix.nl_ovi.json +0 -40
  101. package/tests/generated/auto_GB_capcut.com_0.spec.ts +0 -2
  102. package/tests/generated/auto_NL_bonprix.nl_ovi.spec.ts +0 -2
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "isidewith.com",
3
+ "runContext": {
4
+ "urlPattern": "^https?://(\\w+\\.)?isidewith\\.com/"
5
+ },
6
+ "prehideSelectors": [],
7
+ "detectCmp": [
8
+ {
9
+ "exists": ".overlayContent a[onclick^=\"optin\"]"
10
+ }
11
+ ],
12
+ "detectPopup": [
13
+ {
14
+ "visible": ".overlayContent a[onclick^=\"optin\"]"
15
+ }
16
+ ],
17
+ "optIn": [
18
+ {
19
+ "waitForThenClick": ".overlayContent a[onclick^=\"optin\"]"
20
+ }
21
+ ],
22
+ "optOut": [
23
+ {
24
+ "waitForThenClick": ".overlayBG"
25
+ },
26
+ {
27
+ "waitForVisible": ".overlayContent a[onclick^=\"optin\"]",
28
+ "check": "none",
29
+ "timeout": 2000
30
+ }
31
+ ],
32
+ "test": [
33
+ {
34
+ "visible": ".overlayContent a[onclick^=\"optin\"]",
35
+ "check": "none"
36
+ }
37
+ ]
38
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "landgate",
3
+ "vendorUrl": "https://www.landgate.wa.gov.au/",
4
+ "prehideSelectors": [".privacy-notification[data-cookie-name]"],
5
+ "detectCmp": [{ "exists": ".privacy-notification[data-cookie-name] #js-privacy-notification-ok" }],
6
+ "detectPopup": [{ "visible": ".privacy-notification[data-cookie-name]" }],
7
+ "optIn": [{ "waitForThenClick": "#js-privacy-notification-ok" }],
8
+ "optOut": [{ "waitForThenClick": "#js-privacy-notification-ok" }],
9
+ "test": [{ "waitForVisible": ".privacy-notification[data-cookie-name]", "check": "none", "timeout": 1000 }]
10
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "meta-cookie-dialog-v2",
3
+ "vendorUrl": "https://www.meta.com/",
4
+ "runContext": {
5
+ "urlPattern": "^https?://(\\w+\\.)?meta\\.com/"
6
+ },
7
+ "prehideSelectors": [],
8
+ "detectCmp": [
9
+ {
10
+ "exists": "xpath///div[@role='dialog' and @aria-modal='true']//div[following-sibling::div[@aria-hidden='true'][.//div[@role='button' and @aria-disabled='true']]]/div[@role='button' and @tabindex='0']"
11
+ }
12
+ ],
13
+ "detectPopup": [
14
+ {
15
+ "visible": "xpath///div[@role='dialog' and @aria-modal='true']//div[following-sibling::div[@aria-hidden='true'][.//div[@role='button' and @aria-disabled='true']]]/div[@role='button' and @tabindex='0']"
16
+ }
17
+ ],
18
+ "optIn": [
19
+ {
20
+ "waitForThenClick": "xpath///div[@role='dialog' and @aria-modal='true']//div[preceding-sibling::div[@aria-hidden='true'][.//div[@role='button' and @aria-disabled='true']]]/div[@role='button' and @tabindex='0']",
21
+ "retry": 20,
22
+ "retryInterval": 500
23
+ },
24
+ {
25
+ "waitForVisible": "xpath///div[@role='dialog' and @aria-modal='true']//div[preceding-sibling::div[@aria-hidden='true'][.//div[@role='button' and @aria-disabled='true']]]/div[@role='button' and @tabindex='0']",
26
+ "check": "none"
27
+ }
28
+ ],
29
+ "optOut": [
30
+ {
31
+ "waitForThenClick": "xpath///div[@role='dialog' and @aria-modal='true']//div[following-sibling::div[@aria-hidden='true'][.//div[@role='button' and @aria-disabled='true']]]/div[@role='button' and @tabindex='0']",
32
+ "retry": 20,
33
+ "retryInterval": 500
34
+ },
35
+ {
36
+ "waitForVisible": "xpath///div[@role='dialog' and @aria-modal='true']//div[following-sibling::div[@aria-hidden='true'][.//div[@role='button' and @aria-disabled='true']]]/div[@role='button' and @tabindex='0']",
37
+ "check": "none"
38
+ }
39
+ ]
40
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "pakamera.pl",
3
+ "vendorUrl": "https://www.github.com/orestbida/cookieconsent",
4
+ "comment": "customized CookieConsent v3 with a renamed root container",
5
+ "runContext": {
6
+ "urlPattern": "^https?://(\\w+\\.)?pakamera\\.pl/"
7
+ },
8
+ "prehideSelectors": ["#ccpm"],
9
+ "detectCmp": [{ "exists": "#ccpm" }],
10
+ "detectPopup": [{ "visible": "html.show--consent #ccpm .cm__btn[data-role=all]" }],
11
+ "optIn": [{ "waitForThenClick": "#ccpm .cm__btn[data-role=all]" }],
12
+ "optOut": [
13
+ { "waitForThenClick": "#ccpm .cm__btn[data-role=show]" },
14
+ { "waitForVisible": "#ccpm .pm__btn[data-role=save]" },
15
+ { "click": "#ccpm .pm input.section__toggle:checked:not(:disabled)", "all": true, "optional": true },
16
+ { "click": "#ccpm .pm__btn[data-role=save]" }
17
+ ],
18
+ "test": [{ "waitForVisible": "html.show--consent #ccpm .cm__btn[data-role=all]", "check": "none" }]
19
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "purecookie-cosmetic",
3
+ "cosmetic": true,
4
+ "prehideSelectors": ["#cookieConsentContainer"],
5
+ "detectCmp": [{ "exists": "#cookieConsentContainer [onclick^=\"purecookieDismiss\"], script[src*=\"purecookie\"]" }],
6
+ "detectPopup": [{ "visible": "#cookieConsentContainer" }],
7
+ "optIn": [
8
+ { "waitFor": "#cookieConsentContainer[style*=\"opacity: 1;\"]", "timeout": 2000, "optional": true },
9
+ { "waitForThenClick": "#cookieConsentContainer [onclick^=\"purecookieDismiss\"]" }
10
+ ],
11
+ "optOut": [{ "hide": "#cookieConsentContainer" }],
12
+ "test": [{ "visible": "#cookieConsentContainer", "check": "none" }]
13
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "random-org",
3
+ "vendorUrl": "https://www.random.org/",
4
+ "runContext": {
5
+ "urlPattern": "^https?://(\\w+\\.)?random\\.org/"
6
+ },
7
+ "prehideSelectors": ["#cookie-banner"],
8
+ "detectCmp": [
9
+ {
10
+ "exists": "#cookie-banner #cookie-banner-statistics"
11
+ }
12
+ ],
13
+ "detectPopup": [
14
+ {
15
+ "visible": "#cookie-banner"
16
+ }
17
+ ],
18
+ "optIn": [
19
+ {
20
+ "waitForThenClick": "#cookie-banner button[onclick*=\"'all'\"]"
21
+ }
22
+ ],
23
+ "optOut": [
24
+ {
25
+ "if": { "exists": "#cookie-banner-preferences:checked" },
26
+ "then": [{ "click": "#cookie-banner-preferences" }]
27
+ },
28
+ {
29
+ "if": { "exists": "#cookie-banner-statistics:checked" },
30
+ "then": [{ "click": "#cookie-banner-statistics" }]
31
+ },
32
+ {
33
+ "waitForThenClick": "#cookie-banner button[onclick*=\"'selected'\"]"
34
+ }
35
+ ],
36
+ "test": [
37
+ {
38
+ "cookieContains": "RDOPRIVACY=%5Btrue%2Cfalse%2Cfalse%5D"
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "reverb-gdpr-nag",
3
+ "vendorUrl": "https://reverb.com/",
4
+ "runContext": {
5
+ "urlPattern": "^https?://(www\\.)?reverb\\.com/"
6
+ },
7
+ "prehideSelectors": [],
8
+ "detectCmp": [
9
+ {
10
+ "comment": "only once a choice is stored in the main notice, which also reloads the page",
11
+ "cookieContains": "privacy_settings="
12
+ },
13
+ { "exists": ".gdpr-alert .gdpr-alert__close" }
14
+ ],
15
+ "detectPopup": [{ "visible": ".gdpr-alert .gdpr-alert__overview" }],
16
+ "optIn": [{ "waitForThenClick": ".gdpr-alert .gdpr-alert__close", "retry": 5, "retryInterval": 500 }],
17
+ "optOut": [{ "waitForThenClick": ".gdpr-alert .gdpr-alert__close", "retry": 5, "retryInterval": 500 }]
18
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "reverb",
3
+ "vendorUrl": "https://reverb.com/",
4
+ "runContext": {
5
+ "urlPattern": "^https?://(www\\.)?reverb\\.com/"
6
+ },
7
+ "prehideSelectors": [".rc-notice:has(a[href$='/cookies-policy'])"],
8
+ "detectCmp": [{ "exists": ".rc-notice a[href$='/cookies-policy']" }],
9
+ "detectPopup": [{ "visible": ".rc-notice a[href$='/cookies-policy']" }],
10
+ "optIn": [{ "waitForThenClick": ".rc-notice:has(a[href$='/cookies-policy']) .rc-notice__actions button[data-slot=primary]" }],
11
+ "optOut": [
12
+ {
13
+ "if": { "exists": ".rc-notice:has(a[href$='/cookies-policy']) .rc-notice__actions button[data-slot=secondary]" },
14
+ "then": [{ "waitForThenClick": ".rc-notice:has(a[href$='/cookies-policy']) .rc-notice__actions button[data-slot=secondary]" }],
15
+ "else": [
16
+ { "waitForThenClick": ".rc-notice:has(a[href$='/cookies-policy']) .rc-notice__description button" },
17
+ { "waitFor": ".rc-modal input[name=adData]" },
18
+ { "click": ".rc-modal input.rc-checkbox__input:checked", "all": true, "optional": true },
19
+ { "waitForThenClick": ".rc-modal:has(input[name=adData]) .rc-modal__footer button[data-slot=primary]" }
20
+ ]
21
+ }
22
+ ],
23
+ "test": [{ "cookieContains": "third_party_ad_storage_consent%22%3Afalse" }]
24
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "tallink",
3
+ "vendorUrl": "https://www.tallink.com/",
4
+ "prehideSelectors": ["#cms-web-consent-modal"],
5
+ "detectCmp": [{ "exists": "#cms-web-consent-root #cms-web-consent-modal" }],
6
+ "detectPopup": [{ "visible": "#cms-web-consent-modal" }],
7
+ "optIn": [{ "waitForThenClick": "#cms-web-consent-modal [data-cy=consent-agree-all]" }],
8
+ "optOut": [
9
+ { "waitForThenClick": "#cms-web-consent-modal [data-cy=consent-agree-necessary]" },
10
+ { "waitForVisible": "#cms-web-consent-modal", "check": "none", "timeout": 2000, "optional": true }
11
+ ],
12
+ "test": [{ "cookieContains": "tlnk_cwc=necessary_cookies=true" }, { "cookieContains": "marketing_cookies=true", "negated": true }]
13
+ }
@@ -2,7 +2,10 @@
2
2
  "name": "Tealium",
3
3
  "prehideSelectors": ["#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#__tealiumImplicitmodal,#consent-layer"],
4
4
  "detectCmp": [{ "exists": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *,#__tealiumImplicitmodal *" }, { "eval": "EVAL_TEALIUM_0" }],
5
- "detectPopup": [{ "visible": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *,#__tealiumImplicitmodal *", "check": "any" }],
5
+ "detectPopup": [
6
+ { "visible": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *,#__tealiumImplicitmodal *", "check": "any" },
7
+ { "eval": "EVAL_TEALIUM_NO_DECISION" }
8
+ ],
6
9
  "optOut": [
7
10
  { "eval": "EVAL_TEALIUM_1" },
8
11
  { "eval": "EVAL_TEALIUM_DONOTSELL" },
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "typo3-cookieconsent",
3
+ "prehideSelectors": ["#js-cookieconsent"],
4
+ "detectCmp": [{ "exists": "#js-cookieconsent [data-cookieconsent-accept-none]" }],
5
+ "detectPopup": [{ "visible": "#js-cookieconsent" }],
6
+ "optIn": [{ "waitForThenClick": "#js-cookieconsent [data-cookieconsent-accept-all]" }],
7
+ "optOut": [{ "waitForThenClick": "#js-cookieconsent [data-cookieconsent-accept-none]" }],
8
+ "test": [{ "cookieContains": "CookieConsent=mandatory" }]
9
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "vinnies-org-au",
3
+ "vendorUrl": "https://www.vinnies.org.au/",
4
+ "cosmetic": true,
5
+ "runContext": {
6
+ "urlPattern": "^https?://(\\w+\\.)?vinnies\\.org\\.au/"
7
+ },
8
+ "prehideSelectors": ["div.fixed.bottom-0:has(svg[data-icon=\"cookie-bite\"])"],
9
+ "detectCmp": [
10
+ {
11
+ "exists": "div.fixed.bottom-0:has(svg[data-icon=\"cookie-bite\"]) button"
12
+ }
13
+ ],
14
+ "detectPopup": [
15
+ {
16
+ "visible": "div.fixed.bottom-0:has(svg[data-icon=\"cookie-bite\"])"
17
+ }
18
+ ],
19
+ "optIn": [
20
+ {
21
+ "waitForThenClick": "div.fixed.bottom-0:has(svg[data-icon=\"cookie-bite\"]) button"
22
+ }
23
+ ],
24
+ "optOut": [
25
+ {
26
+ "hide": "div.fixed.bottom-0:has(svg[data-icon=\"cookie-bite\"])"
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "zoho",
3
+ "vendorUrl": "https://www.zoho.com/",
4
+ "cosmetic": false,
5
+ "prehideSelectors": [".zbottom-cp-container"],
6
+ "detectCmp": [{ "exists": ".zbottom-cp-container .zbc-cta-accept" }],
7
+ "detectPopup": [{ "visible": ".zbottom-cp-container" }],
8
+ "optIn": [{ "waitForThenClick": ".zbottom-cp-container .zbc-cta-accept button" }],
9
+ "optOut": [
10
+ {
11
+ "if": { "visible": ".zbottom-cp-container .zbc-cta-ignore button" },
12
+ "then": [{ "click": ".zbottom-cp-container .zbc-cta-ignore button" }],
13
+ "else": [
14
+ { "click": ".zbottom-cp-container .zbc-manage-cta" },
15
+ { "waitForVisible": ".zbc-main .zbc-cta-se" },
16
+ { "click": ".zbc-main .ctog-container.ctog-active:not(.ctog-no)", "all": true, "optional": true },
17
+ { "click": ".zbc-main .zbc-cta-se" }
18
+ ]
19
+ },
20
+ { "waitForVisible": ".zbottom-cp-container", "check": "none", "timeout": 2000 }
21
+ ],
22
+ "test": [{ "eval": "EVAL_ZOHO_TEST" }]
23
+ }