@duckduckgo/autoconsent 16.26.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.
- package/CHANGELOG.md +24 -0
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +2 -2
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/rule-index.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +2 -2
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/rule-index.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +2 -2
- package/dist/autoconsent.esm.js +2 -2
- package/dist/autoconsent.playwright.js +2 -2
- package/dist/autoconsent.standalone.js +3 -3
- package/lib/heuristic-patterns.ts +2 -2
- package/package.json +1 -1
- package/rules/autoconsent/complianz-opt-out.json +6 -0
- package/rules/autoconsent/gemini-google-com.json +9 -0
- package/rules/autoconsent/justwatch-com.json +1 -1
- package/rules/autoconsent/kingrecords-co-jp.json +21 -0
- package/rules/autoconsent/paypal-us.json +4 -3
- package/rules/autoconsent/pornpics-de.json +1 -1
- package/rules/autoconsent/rule34-xxx.json +12 -0
- package/rules/autoconsent/sex.com.json +45 -0
- package/rules/autoconsent/twitch.json +27 -12
- package/rules/autoconsent/xhamster-eu.json +3 -1
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/tests/complianz-opt-out.spec.ts +5 -0
- package/tests/gemini-google-com.spec.ts +5 -0
- package/tests/justwatch-com.spec.ts +1 -1
- package/tests/kingrecords-co-jp.spec.ts +3 -0
- package/tests/paypal-us.spec.ts +4 -0
- package/tests/pornpics-de.spec.ts +1 -1
- package/tests/rule34-xxx.spec.ts +6 -0
- package/tests/sex.com.spec.ts +3 -0
- 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
|
@@ -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"
|
|
@@ -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
|
|
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
|
|
30
|
+
"click": "#formContent input[type='checkbox']:checked",
|
|
31
31
|
"all": true,
|
|
32
32
|
"optional": true
|
|
33
33
|
},
|
|
34
|
-
{ "click": ".cookieAction
|
|
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
|
}
|
|
@@ -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
|
-
|
|
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
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
{ "
|
|
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
|
}
|