@duckduckgo/autoconsent 16.21.0 → 16.23.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 +32 -0
- package/dist/addon-firefox/background.bundle.js +16 -2
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +16 -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/background.bundle.js +16 -2
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +16 -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 +16 -2
- package/dist/autoconsent.esm.js +16 -2
- package/dist/autoconsent.playwright.js +16 -2
- package/dist/autoconsent.standalone.js +17 -3
- package/dist/types/eval-snippets.d.ts +4 -1
- package/lib/eval-snippets.ts +16 -2
- package/package.json +1 -1
- package/rules/autoconsent/appconsent-legacy.json +31 -0
- package/rules/autoconsent/appconsent.json +31 -0
- package/rules/autoconsent/check24.json +30 -0
- package/rules/autoconsent/consentmanager-ncmp.json +34 -0
- package/rules/autoconsent/krown-cookie-banner.json +34 -0
- package/rules/autoconsent/paypal-us.json +23 -9
- package/rules/autoconsent/pornpics-de.json +13 -0
- package/rules/autoconsent/uwv-nl.json +40 -0
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/tests/appconsent-legacy.spec.ts +7 -0
- package/tests/appconsent.spec.ts +7 -0
- package/tests/check24.spec.ts +3 -0
- package/tests/consentmanager-ncmp.spec.ts +5 -0
- package/tests/krown-cookie-banner.spec.ts +3 -0
- package/tests/pornpics-de.spec.ts +3 -0
- package/tests/uwv-nl.spec.ts +3 -0
|
@@ -2,11 +2,13 @@ export declare const snippets: {
|
|
|
2
2
|
EVAL_0: () => void;
|
|
3
3
|
EVAL_DIDOMI_OPT_OUT: () => boolean;
|
|
4
4
|
EVAL_DIDOMI_TEST: () => boolean;
|
|
5
|
-
EVAL_CONSENTMANAGER_1: () =>
|
|
5
|
+
EVAL_CONSENTMANAGER_1: () => boolean;
|
|
6
6
|
EVAL_CONSENTMANAGER_2: () => boolean;
|
|
7
7
|
EVAL_CONSENTMANAGER_3: () => any;
|
|
8
8
|
EVAL_CONSENTMANAGER_4: () => any;
|
|
9
9
|
EVAL_CONSENTMANAGER_5: () => any;
|
|
10
|
+
EVAL_CONSENTMANAGER_NCMP_REJECT: () => boolean;
|
|
11
|
+
EVAL_CONSENTMANAGER_NCMP_ACCEPT: () => boolean;
|
|
10
12
|
EVAL_COOKIEBOT_1: () => boolean;
|
|
11
13
|
EVAL_COOKIEBOT_2: () => boolean;
|
|
12
14
|
EVAL_COOKIEBOT_3: () => any;
|
|
@@ -45,6 +47,7 @@ export declare const snippets: {
|
|
|
45
47
|
EVAL_GDPR_LEGAL_COOKIE_TEST: () => boolean;
|
|
46
48
|
EVAL_IUBENDA_0: () => boolean;
|
|
47
49
|
EVAL_IUBENDA_1: () => boolean;
|
|
50
|
+
EVAL_KROWN_COOKIE_BANNER_TEST: () => boolean;
|
|
48
51
|
EVAL_MICROSOFT_0: () => any;
|
|
49
52
|
EVAL_MICROSOFT_1: () => any;
|
|
50
53
|
EVAL_MICROSOFT_2: () => boolean;
|
package/lib/eval-snippets.ts
CHANGED
|
@@ -22,11 +22,24 @@ export const snippets = {
|
|
|
22
22
|
const disabled = window.Didomi?.getUserConsentStatusForAll?.()?.purposes?.disabled;
|
|
23
23
|
return Array.isArray(disabled) && disabled.length > 0;
|
|
24
24
|
},
|
|
25
|
-
EVAL_CONSENTMANAGER_1: () =>
|
|
26
|
-
|
|
25
|
+
EVAL_CONSENTMANAGER_1: () => {
|
|
26
|
+
const cmpData = window.__cmp?.('getCMPData');
|
|
27
|
+
return !!cmpData && typeof cmpData === 'object';
|
|
28
|
+
},
|
|
29
|
+
EVAL_CONSENTMANAGER_2: () => window.__cmp?.('consentStatus')?.userChoiceExists === false,
|
|
27
30
|
EVAL_CONSENTMANAGER_3: () => __cmp('setConsent', 0),
|
|
28
31
|
EVAL_CONSENTMANAGER_4: () => __cmp('setConsent', 1),
|
|
29
32
|
EVAL_CONSENTMANAGER_5: () => __cmp('consentStatus').userChoiceExists,
|
|
33
|
+
EVAL_CONSENTMANAGER_NCMP_REJECT: () => {
|
|
34
|
+
if (typeof window.__npcmp !== 'function') return false;
|
|
35
|
+
window.__npcmp('reject');
|
|
36
|
+
return true;
|
|
37
|
+
},
|
|
38
|
+
EVAL_CONSENTMANAGER_NCMP_ACCEPT: () => {
|
|
39
|
+
if (typeof window.__npcmp !== 'function') return false;
|
|
40
|
+
window.__npcmp('save');
|
|
41
|
+
return true;
|
|
42
|
+
},
|
|
30
43
|
EVAL_COOKIEBOT_1: () => !!window.Cookiebot,
|
|
31
44
|
EVAL_COOKIEBOT_2: () => !window.Cookiebot.hasResponse && window.Cookiebot.dialog?.visible === true,
|
|
32
45
|
EVAL_COOKIEBOT_3: () => window.Cookiebot.withdraw() || true,
|
|
@@ -146,6 +159,7 @@ export const snippets = {
|
|
|
146
159
|
if (x.checked) x.click();
|
|
147
160
|
}) || true,
|
|
148
161
|
EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
|
|
162
|
+
EVAL_KROWN_COOKIE_BANNER_TEST: () => localStorage.getItem('krown-cookie-banner') === 'true',
|
|
149
163
|
EVAL_MICROSOFT_0: () =>
|
|
150
164
|
Array.from(document.querySelectorAll('div > button'))
|
|
151
165
|
.filter((el) => el.innerText.match('Reject|Ablehnen'))[0]
|
package/package.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "AppConsent legacy",
|
|
3
|
+
"prehideSelectors": ["iframe[srcdoc*='frame-root']"],
|
|
4
|
+
"detectCmp": [
|
|
5
|
+
{
|
|
6
|
+
"exists": "script[src*='cdn.appconsent.io/tcf2/'][src*='core.bundle.js']"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"detectPopup": [
|
|
10
|
+
{
|
|
11
|
+
"visible": "iframe[srcdoc*='frame-root']"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"optIn": [
|
|
15
|
+
{
|
|
16
|
+
"waitForThenClick": ["iframe[srcdoc*='frame-root']", ".button__acceptAll"]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"optOut": [
|
|
20
|
+
{
|
|
21
|
+
"waitForThenClick": ["iframe[srcdoc*='frame-root']", ".button__skip"]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"test": [
|
|
25
|
+
{
|
|
26
|
+
"waitForVisible": "iframe[srcdoc*='frame-root']",
|
|
27
|
+
"timeout": 1000,
|
|
28
|
+
"check": "none"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "AppConsent",
|
|
3
|
+
"prehideSelectors": ["iframe[title='Consent window']"],
|
|
4
|
+
"detectCmp": [
|
|
5
|
+
{
|
|
6
|
+
"exists": "script[src*='cdn.appconsent.io/tcf2-clear/'][src*='core.bundle.js']"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"detectPopup": [
|
|
10
|
+
{
|
|
11
|
+
"visible": "iframe[title='Consent window']"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"optIn": [
|
|
15
|
+
{
|
|
16
|
+
"waitForThenClick": ["iframe[title='Consent window']", ".button__acceptAll"]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"optOut": [
|
|
20
|
+
{
|
|
21
|
+
"waitForThenClick": ["iframe[title='Consent window']", ".button__refuseAll"]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"test": [
|
|
25
|
+
{
|
|
26
|
+
"waitForVisible": "iframe[title='Consent window']",
|
|
27
|
+
"timeout": 1000,
|
|
28
|
+
"check": "none"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "check24",
|
|
3
|
+
"prehideSelectors": [".c24-cookie-consent-wrapper"],
|
|
4
|
+
"detectCmp": [
|
|
5
|
+
{
|
|
6
|
+
"exists": ".c24-cookie-consent-wrapper .c24-cookie-consent-functional"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"detectPopup": [
|
|
10
|
+
{
|
|
11
|
+
"visible": ".c24-cookie-consent-notice"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"optIn": [
|
|
15
|
+
{
|
|
16
|
+
"waitForThenClick": ".c24-cookie-consent-notice .c24-cookie-consent-button:not(.c24-cookie-consent-button-secondary)"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"optOut": [
|
|
20
|
+
{
|
|
21
|
+
"waitForThenClick": ".c24-cookie-consent-wrapper .c24-cookie-consent-functional"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"test": [
|
|
25
|
+
{
|
|
26
|
+
"visible": ".c24-cookie-consent-wrapper",
|
|
27
|
+
"check": "none"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "consentmanager-ncmp",
|
|
3
|
+
"vendorUrl": "https://www.consentmanager.net/",
|
|
4
|
+
"prehideSelectors": ["#ncmp__tool .ncmp__banner"],
|
|
5
|
+
"detectCmp": [
|
|
6
|
+
{
|
|
7
|
+
"exists": "#ncmp__tool .ncmp__banner.ncmp__active"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"detectPopup": [
|
|
11
|
+
{
|
|
12
|
+
"visible": "#ncmp__tool .ncmp__banner.ncmp__active",
|
|
13
|
+
"check": "any"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"optIn": [
|
|
17
|
+
{
|
|
18
|
+
"eval": "EVAL_CONSENTMANAGER_NCMP_ACCEPT"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"optOut": [
|
|
22
|
+
{
|
|
23
|
+
"wait": 500
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"eval": "EVAL_CONSENTMANAGER_NCMP_REJECT"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"test": [
|
|
30
|
+
{
|
|
31
|
+
"cookieContains": "ncmp="
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "krown-cookie-banner",
|
|
3
|
+
"vendorUrl": "https://krownthemes.com/",
|
|
4
|
+
"cosmetic": false,
|
|
5
|
+
"prehideSelectors": ["modal-box[data-options*=\"cookies\"] .modal-object--cookie"],
|
|
6
|
+
"detectCmp": [
|
|
7
|
+
{
|
|
8
|
+
"exists": ".modal-object--cookie [data-js-cookies-decline]"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"detectPopup": [
|
|
12
|
+
{
|
|
13
|
+
"visible": ".modal-object--cookie [data-js-cookies-decline]"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"optIn": [
|
|
17
|
+
{
|
|
18
|
+
"waitForThenClick": ".modal-object--cookie [data-js-cookies-accept]"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"optOut": [
|
|
22
|
+
{
|
|
23
|
+
"waitForThenClick": ".modal-object--cookie [data-js-cookies-decline]"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"test": [
|
|
27
|
+
{
|
|
28
|
+
"wait": 500
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"eval": "EVAL_KROWN_COOKIE_BANNER_TEST"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paypal-us",
|
|
3
|
-
"prehideSelectors": ["#ccpaCookieContent_wrapper, article.ppvx_modal--overpanel"],
|
|
4
|
-
"detectCmp": [{ "exists": "#ccpaCookieBanner, .privacy-sheet-content" }],
|
|
5
|
-
"detectPopup": [{ "visible": "#ccpaCookieBanner, .privacy-sheet-content" }],
|
|
3
|
+
"prehideSelectors": ["#ccpaCookieContent_wrapper, article.ppvx_modal--overpanel, #cookiePrefsModal"],
|
|
4
|
+
"detectCmp": [{ "exists": "#ccpaCookieBanner, .privacy-sheet-content, #cookiePrefsModal" }],
|
|
5
|
+
"detectPopup": [{ "visible": "#ccpaCookieBanner, .privacy-sheet-content, #cookiePrefsModal" }],
|
|
6
6
|
"optIn": [{ "click": "#acceptAllButton" }],
|
|
7
7
|
"optOut": [
|
|
8
8
|
{
|
|
@@ -13,13 +13,27 @@
|
|
|
13
13
|
"if": { "exists": "a#manageCookiesLink" },
|
|
14
14
|
"then": [{ "click": "a#manageCookiesLink" }],
|
|
15
15
|
"else": [
|
|
16
|
-
{ "waitForVisible": ".privacy-sheet-content #formContent" },
|
|
17
16
|
{
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
"if": { "exists": "#cookiePrefsModal" },
|
|
18
|
+
"then": [
|
|
19
|
+
{ "waitForVisible": "#cookiePrefsModal #submitCookiesBtn, .confirmCookie #submitCookiesBtn" },
|
|
20
|
+
{
|
|
21
|
+
"click": "#cookiePrefsModal input[type='checkbox']:checked",
|
|
22
|
+
"all": true,
|
|
23
|
+
"optional": true
|
|
24
|
+
},
|
|
25
|
+
{ "click": "#cookiePrefsModal #submitCookiesBtn, .confirmCookie #submitCookiesBtn" }
|
|
26
|
+
],
|
|
27
|
+
"else": [
|
|
28
|
+
{ "waitForVisible": ".privacy-sheet-content #formContent" },
|
|
29
|
+
{
|
|
30
|
+
"click": "#formContent .cookiepref-11m2iee-checkbox_base input:checked",
|
|
31
|
+
"all": true,
|
|
32
|
+
"optional": true
|
|
33
|
+
},
|
|
34
|
+
{ "click": ".cookieAction.saveCookie,.confirmCookie #submitCookiesBtn" }
|
|
35
|
+
]
|
|
36
|
+
}
|
|
23
37
|
]
|
|
24
38
|
}
|
|
25
39
|
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pornpics.de",
|
|
3
|
+
"runContext": {
|
|
4
|
+
"urlPattern": "^https?://(www\\.)?pornpics\\.de/"
|
|
5
|
+
},
|
|
6
|
+
"detectCmp": [{ "exists": "#cookie-form" }],
|
|
7
|
+
"detectPopup": [{ "visible": "#cookie-form" }],
|
|
8
|
+
"optIn": [{ "waitForThenClick": "#cookie-form .accept" }],
|
|
9
|
+
"optOut": [{ "waitForThenClick": "#cookie-form .reject" }],
|
|
10
|
+
"test": [
|
|
11
|
+
{ "cookieContains": "_cookieNoticeSettings=%7B%22performance%22%3Afalse%2C%22targeting%22%3Afalse%2C%22analytic%22%3Afalse%7D" }
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "uwv-nl",
|
|
3
|
+
"_metadata": {
|
|
4
|
+
"vendorUrl": "https://www.uwv.nl/"
|
|
5
|
+
},
|
|
6
|
+
"cosmetic": false,
|
|
7
|
+
"runContext": {
|
|
8
|
+
"main": true,
|
|
9
|
+
"frame": false,
|
|
10
|
+
"urlPattern": "^https?://(?:www\\.)?uwv\\.nl/"
|
|
11
|
+
},
|
|
12
|
+
"prehideSelectors": ["#js-pw-consent-wrapper bgl-modal[test-id='cookie-modal']"],
|
|
13
|
+
"detectCmp": [
|
|
14
|
+
{
|
|
15
|
+
"exists": "#js-pw-consent-wrapper bgl-modal[test-id='cookie-modal']"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"detectPopup": [
|
|
19
|
+
{
|
|
20
|
+
"visible": "#js-pw-consent-wrapper [data-ta-id='pw-consent-rejectAllButton']"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"optIn": [
|
|
24
|
+
{
|
|
25
|
+
"waitForThenClick": "#js-pw-consent-wrapper [data-ta-id='pw-consent-acceptAllButton']"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"optOut": [
|
|
29
|
+
{
|
|
30
|
+
"waitForThenClick": "#js-pw-consent-wrapper [data-ta-id='pw-consent-rejectAllButton']"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"test": [
|
|
34
|
+
{
|
|
35
|
+
"waitForVisible": "#js-pw-consent-wrapper [data-ta-id='pw-consent-rejectAllButton']",
|
|
36
|
+
"check": "none",
|
|
37
|
+
"timeout": 2000
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|