@duckduckgo/autoconsent 16.25.0 → 16.27.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 (41) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/addon-firefox/compact-rules.json +1 -1
  3. package/dist/addon-firefox/content.bundle.js +2 -2
  4. package/dist/addon-firefox/manifest.json +1 -1
  5. package/dist/addon-firefox/rule-index.json +1 -1
  6. package/dist/addon-firefox/rules.json +1 -1
  7. package/dist/addon-mv3/compact-rules.json +1 -1
  8. package/dist/addon-mv3/content.bundle.js +2 -2
  9. package/dist/addon-mv3/manifest.json +1 -1
  10. package/dist/addon-mv3/rule-index.json +1 -1
  11. package/dist/addon-mv3/rules.json +1 -1
  12. package/dist/autoconsent.cjs.js +2 -2
  13. package/dist/autoconsent.esm.js +2 -2
  14. package/dist/autoconsent.playwright.js +2 -2
  15. package/dist/autoconsent.standalone.js +3 -3
  16. package/lib/heuristic-patterns.ts +2 -2
  17. package/package.json +1 -1
  18. package/rules/autoconsent/complianz-opt-out.json +6 -0
  19. package/rules/autoconsent/cookiefirst.json +49 -20
  20. package/rules/autoconsent/gemini-google-com.json +9 -0
  21. package/rules/autoconsent/justwatch-com.json +1 -1
  22. package/rules/autoconsent/kingrecords-co-jp.json +21 -0
  23. package/rules/autoconsent/paypal-us.json +4 -3
  24. package/rules/autoconsent/pornpics-de.json +1 -1
  25. package/rules/autoconsent/rule34-xxx.json +12 -0
  26. package/rules/autoconsent/sex.com.json +45 -0
  27. package/rules/autoconsent/twitch.json +27 -12
  28. package/rules/autoconsent/xhamster-eu.json +3 -1
  29. package/rules/compact-rules.json +1 -1
  30. package/rules/rule-index.json +1 -1
  31. package/rules/rules.json +1 -1
  32. package/tests/complianz-opt-out.spec.ts +5 -0
  33. package/tests/cookiefirst.spec.ts +5 -1
  34. package/tests/gemini-google-com.spec.ts +5 -0
  35. package/tests/justwatch-com.spec.ts +1 -1
  36. package/tests/kingrecords-co-jp.spec.ts +3 -0
  37. package/tests/paypal-us.spec.ts +4 -0
  38. package/tests/pornpics-de.spec.ts +1 -1
  39. package/tests/rule34-xxx.spec.ts +6 -0
  40. package/tests/sex.com.spec.ts +3 -0
  41. package/tests-wtr/heuristics/heuristics-utils.test.ts +6 -0
@@ -163,8 +163,8 @@ const REJECT_PATTERNS_ENGLISH = [
163
163
  // note that "reject and subscribe" and "reject and pay" are excluded via BUTTON_NEVER_MATCH_PATTERNS
164
164
  /^\s*(no,?\s*)?(i\s+)?(reject|deny|refuse|decline|disable)\s*(all)?\s*(but|except)?\s*(non[- ]?essential|un(necessary|required)|optional|additional|targeting|analytics|marketing|non[- ]?necessary|extra|tracking|advertising|necessary|essential)?\s*(cookies)?\s*(and\s+close)?\s*$/is,
165
165
 
166
- // e.g. "i do not accept", "do not accept cookies"
167
- /^\s*(i\s+)?do\s+not\s+accept\s*(cookies)?\s*$/is,
166
+ // e.g. "i do not accept", "do not accept cookies", "i do not accept the use of cookies"
167
+ /^\s*(no,?\s*)?(i\s+)?do\s+not\s+accept\s*(the\s+use\s+of\s+)?(any\s+)?(cookies)?\s*$/is,
168
168
 
169
169
  // e.g. "continue without accepting", "continue without agreeing", "continue without agreeing →"
170
170
  /^\s*(continue|proceed|continue\s+browsing)\s+without\s+(accepting|agreeing|consent|cookies|tracking)(\s*→)?\s*$/is,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duckduckgo/autoconsent",
3
- "version": "16.25.0",
3
+ "version": "16.27.0",
4
4
  "description": "",
5
5
  "types": "./dist/types/web.d.ts",
6
6
  "exports": {
@@ -26,6 +26,12 @@
26
26
  }
27
27
  ],
28
28
  "optOut": [
29
+ {
30
+ "comment": "the popup markup exists before the library opens it; clicking too early gets undone by the pending open",
31
+ "waitFor": "[aria-describedby=\"cookieconsent:desc\"].cc-type-opt-out:not(.cc-invisible)",
32
+ "timeout": 2000,
33
+ "optional": true
34
+ },
29
35
  {
30
36
  "if": {
31
37
  "exists": ".cc-deny"
@@ -2,32 +2,61 @@
2
2
  "name": "cookiefirst.com",
3
3
  "prehideSelectors": ["#cookiefirst-root,.cookiefirst-root,[aria-labelledby=cookie-preference-panel-title]"],
4
4
  "detectCmp": [{ "exists": "#cookiefirst-root,.cookiefirst-root" }],
5
- "detectPopup": [{ "visible": "#cookiefirst-root,.cookiefirst-root" }],
6
- "optIn": [{ "click": "button[data-cookiefirst-action=accept]" }],
5
+ "detectPopup": [
6
+ {
7
+ "visible": "#cookiefirst-root button[data-cookiefirst-action],.cookiefirst-root button[data-cookiefirst-action],#btnAcceptAllCookies,#btnRejectAllCookies,#btnAdjustSettings,[aria-labelledby=cookie-preference-panel-title] button",
8
+ "check": "any"
9
+ }
10
+ ],
11
+ "optIn": [
12
+ {
13
+ "any": [{ "click": "button[data-cookiefirst-action=accept]" }, { "click": "#btnAcceptAllCookies" }]
14
+ }
15
+ ],
7
16
  "optOut": [
8
17
  {
9
18
  "if": {
10
- "exists": "button[data-cookiefirst-action=adjust]"
19
+ "exists": "button[data-cookiefirst-action=reject]"
11
20
  },
12
- "then": [
13
- {
14
- "click": "button[data-cookiefirst-action=adjust]"
15
- },
16
- {
17
- "waitForVisible": "[data-cookiefirst-widget=modal]",
18
- "timeout": 1000
19
- },
20
- {
21
- "eval": "EVAL_COOKIEFIRST_1"
22
- },
23
- {
24
- "wait": 1000
25
- },
21
+ "then": [{ "click": "button[data-cookiefirst-action=reject]" }],
22
+ "else": [
26
23
  {
27
- "click": "button[data-cookiefirst-action=save]"
24
+ "if": {
25
+ "exists": "#btnRejectAllCookies"
26
+ },
27
+ "then": [
28
+ { "waitForVisible": "#btnRejectAllCookies", "timeout": 5000 },
29
+ { "click": "#btnRejectAllCookies" },
30
+ { "wait": 1500 }
31
+ ],
32
+ "else": [
33
+ {
34
+ "if": {
35
+ "exists": "button[data-cookiefirst-action=adjust]"
36
+ },
37
+ "then": [
38
+ {
39
+ "click": "button[data-cookiefirst-action=adjust]"
40
+ },
41
+ {
42
+ "waitForVisible": "[data-cookiefirst-widget=modal]",
43
+ "timeout": 1000
44
+ },
45
+ {
46
+ "eval": "EVAL_COOKIEFIRST_1"
47
+ },
48
+ {
49
+ "wait": 1000
50
+ },
51
+ {
52
+ "click": "button[data-cookiefirst-action=save]"
53
+ }
54
+ ],
55
+ "else": [{ "click": "button[data-cookiefirst-action=reject]" }]
56
+ }
57
+ ]
28
58
  }
29
- ],
30
- "else": [{ "click": "button[data-cookiefirst-action=reject]" }]
59
+ ]
31
60
  }
32
61
  ],
33
62
  "test": [
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "gemini.google.com",
3
+ "prehideSelectors": ["[data-test-id=\"cookie-banner-body\"]"],
4
+ "detectCmp": [{ "exists": "cookie-banner [data-test-id=\"cookie-banner-body\"] [data-test-id=\"reject-button\"]" }],
5
+ "detectPopup": [{ "visible": "[data-test-id=\"cookie-banner-body\"]" }],
6
+ "optIn": [{ "waitForThenClick": "[data-test-id=\"cookie-banner-body\"] [data-test-id=\"accept-button\"]" }],
7
+ "optOut": [{ "waitForThenClick": "[data-test-id=\"cookie-banner-body\"] [data-test-id=\"reject-button\"]" }],
8
+ "test": []
9
+ }
@@ -7,7 +7,7 @@
7
7
  "optOut": [
8
8
  { "click": ".consent-banner__actions button.basic-button.secondary" },
9
9
  { "waitForThenClick": ".consent-modal__footer button.basic-button.secondary" },
10
- { "waitForThenClick": ".consent-modal ion-content > div > a:nth-child(9)" },
10
+ { "waitForThenClick": ".consent-modal .base-modal__body a", "all": true },
11
11
  { "click": "label.consent-switch input[type=checkbox]:checked", "all": true, "optional": true },
12
12
  { "waitForVisible": ".consent-modal__footer button.basic-button.primary" },
13
13
  { "click": ".consent-modal__footer button.basic-button.primary" }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "kingrecords-co-jp",
3
+ "vendorUrl": "https://www.kingrecords.co.jp/",
4
+ "runContext": {
5
+ "urlPattern": "^https?://(?:[^/]+\\.)?kingrecords\\.co\\.jp/"
6
+ },
7
+ "prehideSelectors": [".cookie:has(.cookie__inner .cookie__button)"],
8
+ "detectCmp": [{ "exists": ".cookie > .cookie__inner > .cookie__button > a" }],
9
+ "detectPopup": [{ "visible": ".cookie > .cookie__inner > .cookie__button > a" }],
10
+ "optIn": [
11
+ { "waitFor": "#loader.is--show", "timeout": 10000, "optional": true },
12
+ { "waitForThenClick": ".cookie > .cookie__inner > .cookie__button > a" }
13
+ ],
14
+ "optOut": [
15
+ { "waitFor": "#loader.is--show", "timeout": 10000, "optional": true },
16
+ { "waitForThenClick": ".cookie > .cookie__inner > .cookie__button > a" },
17
+ { "if": { "visible": ".cookie" }, "then": [{ "wait": 1000 }, { "click": ".cookie > .cookie__inner > .cookie__button > a" }] },
18
+ { "waitForVisible": ".cookie", "check": "none", "timeout": 5000 }
19
+ ],
20
+ "test": [{ "cookieContains": "cookiesubmit=1" }]
21
+ }
@@ -27,16 +27,17 @@
27
27
  "else": [
28
28
  { "waitForVisible": ".privacy-sheet-content #formContent" },
29
29
  {
30
- "click": "#formContent .cookiepref-11m2iee-checkbox_base input:checked",
30
+ "click": "#formContent input[type='checkbox']:checked",
31
31
  "all": true,
32
32
  "optional": true
33
33
  },
34
- { "click": ".cookieAction.saveCookie,.confirmCookie #submitCookiesBtn" }
34
+ { "click": ".cookieAction #submitCookiesBtn" }
35
35
  ]
36
36
  }
37
37
  ]
38
38
  }
39
39
  ]
40
40
  }
41
- ]
41
+ ],
42
+ "test": [{ "wait": 1000 }, { "cookieContains": "type%3Dexplicit" }]
42
43
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pornpics.de",
3
3
  "runContext": {
4
- "urlPattern": "^https?://(www\\.)?pornpics\\.de/"
4
+ "urlPattern": "^https?://(www\\.)?pornpics\\.(com|de)/"
5
5
  },
6
6
  "detectCmp": [{ "exists": "#cookie-form" }],
7
7
  "detectPopup": [{ "visible": "#cookie-form" }],
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "rule34-xxx",
3
+ "runContext": {
4
+ "urlPattern": "^https?://(www\\.)?rule34\\.xxx/"
5
+ },
6
+ "prehideSelectors": ["#gdprconsent.gdprcontainer"],
7
+ "detectCmp": [{ "exists": "#gdprconsent.gdprcontainer" }],
8
+ "detectPopup": [{ "visible": "#gdprconsent.gdprcontainer" }],
9
+ "optIn": [{ "waitForThenClick": "#gdprconsent .gdprbutton button" }],
10
+ "optOut": [{ "waitForThenClick": "#gdprconsent .gdprbutton a" }],
11
+ "test": [{ "cookieContains": "gdpr-consent=0" }]
12
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "sex.com",
3
+ "runContext": {
4
+ "urlPattern": "^https?://(\\w+\\.)?sex\\.com/"
5
+ },
6
+ "prehideSelectors": ["[class*=\"cookie-consent-required\"]"],
7
+ "detectCmp": [
8
+ {
9
+ "comment": "the flag is cleared once consent is stored, so it prevents re-detecting the leftover markup",
10
+ "exists": "html[data-cookie-consent-required] [data-testid=\"accept-all-cookie-button\"]"
11
+ }
12
+ ],
13
+ "detectPopup": [
14
+ {
15
+ "visible": "[data-testid=\"accept-all-cookie-button\"]"
16
+ }
17
+ ],
18
+ "optIn": [
19
+ {
20
+ "comment": "the modal is server-rendered, buttons only respond once the dialog is hydrated and locks scrolling",
21
+ "waitFor": "body[data-scroll-locked]"
22
+ },
23
+ {
24
+ "waitForThenClick": "[data-testid=\"accept-all-cookie-button\"]"
25
+ }
26
+ ],
27
+ "optOut": [
28
+ {
29
+ "comment": "the modal is server-rendered, buttons only respond once the dialog is hydrated and locks scrolling",
30
+ "waitFor": "body[data-scroll-locked]"
31
+ },
32
+ {
33
+ "comment": "optional categories default to off, so confirming the defaults rejects them",
34
+ "waitForThenClick": "[data-testid=\"customize-cookie-button\"]"
35
+ },
36
+ {
37
+ "waitForThenClick": "[data-testid=\"confirm-settings-cookie-button\"]"
38
+ }
39
+ ],
40
+ "test": [
41
+ {
42
+ "cookieContains": "%22analytics%22%3Afalse"
43
+ }
44
+ ]
45
+ }
@@ -1,20 +1,35 @@
1
1
  {
2
2
  "name": "twitch.tv",
3
3
  "runContext": {
4
- "urlPattern": "^https?://([\\w-]+\\.)?twitch\\.tv"
4
+ "urlPattern": "^https?://([\\w-]+\\.)?twitch\\.tv/"
5
5
  },
6
- "prehideSelectors": [
7
- "div:has(> .consent-banner .consent-banner__content--gdpr-v2),.ReactModalPortal:has([data-a-target=consent-modal-save])"
6
+ "prehideSelectors": ["[data-a-target=\"consent-banner\"],.ReactModalPortal:has([data-a-target=consent-modal-save])"],
7
+ "detectCmp": [{ "exists": "[data-a-target=\"consent-banner\"]" }],
8
+ "detectPopup": [{ "visible": "[data-a-target=\"consent-banner\"]" }],
9
+ "optIn": [
10
+ {
11
+ "if": { "exists": "[data-a-target=\"consent-banner-accept\"]" },
12
+ "then": [{ "click": "button[data-a-target=\"consent-banner-accept\"]" }],
13
+ "else": [{ "click": "[data-a-target=\"consent-banner\"] button:not([data-a-target])" }]
14
+ }
8
15
  ],
9
- "detectCmp": [{ "exists": ".consent-banner .consent-banner__content--gdpr-v2" }],
10
- "detectPopup": [{ "visible": ".consent-banner .consent-banner__content--gdpr-v2" }],
11
- "optIn": [{ "click": "button[data-a-target=\"consent-banner-accept\"]" }],
12
16
  "optOut": [
13
- { "hide": "div:has(> .consent-banner .consent-banner__content--gdpr-v2)" },
14
- { "click": "button[data-a-target=\"consent-banner-manage-preferences\"]" },
15
- { "waitFor": "input[type=checkbox][data-a-target=tw-checkbox]" },
16
- { "click": "input[type=checkbox][data-a-target=tw-checkbox][checked]:not([disabled])", "all": true, "optional": true },
17
- { "waitForThenClick": "[data-a-target=consent-modal-save]" },
18
- { "waitForVisible": ".ReactModalPortal:has([data-a-target=consent-modal-save])", "check": "none" }
17
+ {
18
+ "if": { "exists": "[data-a-target=\"consent-banner-accept\"]" },
19
+ "then": [
20
+ { "click": "[data-a-target=\"consent-banner\"] button:not([data-a-target])" },
21
+ { "waitForVisible": "[data-a-target=\"consent-banner\"]", "check": "none" }
22
+ ],
23
+ "else": [
24
+ { "click": "button[data-a-target=\"consent-banner-manage-preferences\"]" },
25
+ { "waitFor": "input[type=checkbox][data-a-target=tw-checkbox]" },
26
+ {
27
+ "click": "input[type=checkbox][data-a-target=tw-checkbox]:not(:checked):not([disabled])",
28
+ "optional": true
29
+ },
30
+ { "waitForThenClick": "[data-a-target=consent-modal-save]" },
31
+ { "waitForVisible": ".ReactModalPortal:has([data-a-target=consent-modal-save])", "check": "none" }
32
+ ]
33
+ }
19
34
  ]
20
35
  }
@@ -8,7 +8,9 @@
8
8
  "detectPopup": [{ "visible": "[data-role=\"cookies-modal\"] [data-opt-hydration=\"cookies-dialog-eu\"]" }],
9
9
  "optIn": [{ "waitForThenClick": "[data-role=\"cookies-modal\"] [class*=experimentalButtons] button:nth-of-type(1)" }],
10
10
  "optOut": [
11
- { "waitForThenClick": "[data-role=\"cookies-modal\"] [class*=experimentalButtons] button:nth-of-type(2)" },
11
+ { "waitForVisible": "[data-role=\"cookies-modal\"] [class*=experimentalButtons] button:nth-of-type(2)" },
12
+ { "wait": 500 },
13
+ { "click": "[data-role=\"cookies-modal\"] [class*=experimentalButtons] button:nth-of-type(2)" },
12
14
  { "hide": "[data-role=\"cookies-modal\"] [class*=container]", "optional": true }
13
15
  ]
14
16
  }