@duckduckgo/autoconsent 7.0.0 → 7.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.
- package/CHANGELOG.md +20 -0
- package/build.sh +1 -1
- package/data/coverage.json +1014 -937
- package/dist/addon-firefox/background.bundle.js +3 -0
- package/dist/addon-firefox/content.bundle.js +3 -0
- package/dist/addon-firefox/rules.json +54 -6
- package/dist/addon-mv3/background.bundle.js +3 -0
- package/dist/addon-mv3/content.bundle.js +3 -0
- package/dist/addon-mv3/rules.json +54 -6
- package/dist/autoconsent.cjs.js +3 -0
- package/dist/autoconsent.esm.js +3 -0
- package/dist/autoconsent.playwright.js +1 -1
- package/lib/eval-snippets.ts +3 -0
- package/package.json +1 -1
- package/rules/autoconsent/iwink.json +19 -0
- package/rules/autoconsent/tealium.json +19 -6
- package/rules/rules.json +54 -6
- package/tests/iwink.spec.ts +8 -0
- package/tests/tealium.spec.ts +6 -0
package/lib/eval-snippets.ts
CHANGED
|
@@ -59,6 +59,7 @@ export const snippets = {
|
|
|
59
59
|
EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
|
|
60
60
|
EVAL_IUBENDA_0: () => document.querySelectorAll('.purposes-item input[type=checkbox]:not([disabled])').forEach(x => {if(x.checked) x.click()}) || true,
|
|
61
61
|
EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
|
|
62
|
+
EVAL_IWINK_TEST: () => document.cookie.includes('cookie_permission_granted=no'),
|
|
62
63
|
EVAL_JQUERY_COOKIEBAR_0: () => !document.cookie.includes('cookies-state=accepted'),
|
|
63
64
|
EVAL_MEDIAVINE_0: () => document.querySelectorAll("[data-name=\"mediavine-gdpr-cmp\"] input[type=checkbox]").forEach(x => x.checked && x.click()) || true,
|
|
64
65
|
EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll('div > button')).filter(el => el.innerText.match('Reject|Ablehnen'))[0].click() || true,
|
|
@@ -81,8 +82,10 @@ export const snippets = {
|
|
|
81
82
|
EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes('false'),
|
|
82
83
|
EVAL_TEALIUM_0: () => typeof window.utag !== 'undefined' && typeof utag.gdpr === 'object',
|
|
83
84
|
EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
|
|
85
|
+
EVAL_TEALIUM_DONOTSELL: () => utag.gdpr.dns?.setDnsState(false) || true,
|
|
84
86
|
EVAL_TEALIUM_2: () => utag.gdpr.setConsentValue(true) || true,
|
|
85
87
|
EVAL_TEALIUM_3: () => utag.gdpr.getConsentState() !== 1,
|
|
88
|
+
EVAL_TEALIUM_DONOTSELL_CHECK: () => utag.gdpr.dns?.getDnsState() !== 1,
|
|
86
89
|
EVAL_TESTCMP_0: () => window.results.results[0] === 'button_clicked',
|
|
87
90
|
EVAL_TESTCMP_COSMETIC_0: () => window.results.results[0] === 'banner_hidden',
|
|
88
91
|
EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "iWink",
|
|
3
|
+
"prehideSelectors": ["body.cookies-request #cookie-bar"],
|
|
4
|
+
"detectCmp": [
|
|
5
|
+
{ "exists": "body.cookies-request #cookie-bar" }
|
|
6
|
+
],
|
|
7
|
+
"detectPopup": [
|
|
8
|
+
{ "visible": "body.cookies-request #cookie-bar" }
|
|
9
|
+
],
|
|
10
|
+
"optIn": [
|
|
11
|
+
{ "waitForThenClick": "body.cookies-request #cookie-bar .allow-cookies" }
|
|
12
|
+
],
|
|
13
|
+
"optOut": [
|
|
14
|
+
{ "waitForThenClick": "body.cookies-request #cookie-bar .disallow-cookies" }
|
|
15
|
+
],
|
|
16
|
+
"test": [
|
|
17
|
+
{"eval": "EVAL_IWINK_TEST"}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Tealium",
|
|
3
3
|
"prehideSelectors": ["#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#consent-layer"],
|
|
4
|
-
"detectCmp": [
|
|
5
|
-
|
|
4
|
+
"detectCmp": [
|
|
5
|
+
{ "exists": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *" },
|
|
6
|
+
{ "eval": "EVAL_TEALIUM_0" }
|
|
7
|
+
],
|
|
8
|
+
"detectPopup": [
|
|
9
|
+
{ "visible": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *", "check": "any" }
|
|
10
|
+
],
|
|
6
11
|
"optOut": [
|
|
7
|
-
{ "
|
|
8
|
-
{ "eval": "
|
|
12
|
+
{ "eval": "EVAL_TEALIUM_1" },
|
|
13
|
+
{ "eval": "EVAL_TEALIUM_DONOTSELL" },
|
|
14
|
+
{ "hide": ["#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs"] },
|
|
15
|
+
{
|
|
16
|
+
"waitForThenClick": "#cm-acceptNone,.js-accept-essential-cookies",
|
|
17
|
+
"timeout": 1000,
|
|
18
|
+
"optional": true
|
|
19
|
+
}
|
|
9
20
|
],
|
|
10
21
|
"optIn": [
|
|
11
|
-
{ "hide": ["#__tealiumGDPRecModal"] },
|
|
22
|
+
{ "hide": ["#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs"] },
|
|
12
23
|
{ "eval": "EVAL_TEALIUM_2" }
|
|
13
24
|
],
|
|
14
25
|
"test": [
|
|
15
|
-
{ "eval": "EVAL_TEALIUM_3" }
|
|
26
|
+
{ "eval": "EVAL_TEALIUM_3" },
|
|
27
|
+
{ "eval": "EVAL_TEALIUM_DONOTSELL_CHECK" },
|
|
28
|
+
{ "visible": "#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs", "check": "none" }
|
|
16
29
|
]
|
|
17
30
|
}
|
package/rules/rules.json
CHANGED
|
@@ -2629,6 +2629,37 @@
|
|
|
2629
2629
|
}
|
|
2630
2630
|
]
|
|
2631
2631
|
},
|
|
2632
|
+
{
|
|
2633
|
+
"name": "iWink",
|
|
2634
|
+
"prehideSelectors": [
|
|
2635
|
+
"body.cookies-request #cookie-bar"
|
|
2636
|
+
],
|
|
2637
|
+
"detectCmp": [
|
|
2638
|
+
{
|
|
2639
|
+
"exists": "body.cookies-request #cookie-bar"
|
|
2640
|
+
}
|
|
2641
|
+
],
|
|
2642
|
+
"detectPopup": [
|
|
2643
|
+
{
|
|
2644
|
+
"visible": "body.cookies-request #cookie-bar"
|
|
2645
|
+
}
|
|
2646
|
+
],
|
|
2647
|
+
"optIn": [
|
|
2648
|
+
{
|
|
2649
|
+
"waitForThenClick": "body.cookies-request #cookie-bar .allow-cookies"
|
|
2650
|
+
}
|
|
2651
|
+
],
|
|
2652
|
+
"optOut": [
|
|
2653
|
+
{
|
|
2654
|
+
"waitForThenClick": "body.cookies-request #cookie-bar .disallow-cookies"
|
|
2655
|
+
}
|
|
2656
|
+
],
|
|
2657
|
+
"test": [
|
|
2658
|
+
{
|
|
2659
|
+
"eval": "EVAL_IWINK_TEST"
|
|
2660
|
+
}
|
|
2661
|
+
]
|
|
2662
|
+
},
|
|
2632
2663
|
{
|
|
2633
2664
|
"name": "johnlewis.com",
|
|
2634
2665
|
"prehideSelectors": [
|
|
@@ -4307,7 +4338,7 @@
|
|
|
4307
4338
|
],
|
|
4308
4339
|
"detectCmp": [
|
|
4309
4340
|
{
|
|
4310
|
-
"
|
|
4341
|
+
"exists": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *"
|
|
4311
4342
|
},
|
|
4312
4343
|
{
|
|
4313
4344
|
"eval": "EVAL_TEALIUM_0"
|
|
@@ -4315,22 +4346,32 @@
|
|
|
4315
4346
|
],
|
|
4316
4347
|
"detectPopup": [
|
|
4317
4348
|
{
|
|
4318
|
-
"visible": "#__tealiumGDPRecModal"
|
|
4349
|
+
"visible": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *",
|
|
4350
|
+
"check": "any"
|
|
4319
4351
|
}
|
|
4320
4352
|
],
|
|
4321
4353
|
"optOut": [
|
|
4322
4354
|
{
|
|
4323
|
-
"
|
|
4324
|
-
"timeout": 1000
|
|
4355
|
+
"eval": "EVAL_TEALIUM_1"
|
|
4325
4356
|
},
|
|
4326
4357
|
{
|
|
4327
|
-
"eval": "
|
|
4358
|
+
"eval": "EVAL_TEALIUM_DONOTSELL"
|
|
4359
|
+
},
|
|
4360
|
+
{
|
|
4361
|
+
"hide": [
|
|
4362
|
+
"#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs"
|
|
4363
|
+
]
|
|
4364
|
+
},
|
|
4365
|
+
{
|
|
4366
|
+
"waitForThenClick": "#cm-acceptNone,.js-accept-essential-cookies",
|
|
4367
|
+
"timeout": 1000,
|
|
4368
|
+
"optional": true
|
|
4328
4369
|
}
|
|
4329
4370
|
],
|
|
4330
4371
|
"optIn": [
|
|
4331
4372
|
{
|
|
4332
4373
|
"hide": [
|
|
4333
|
-
"#__tealiumGDPRecModal"
|
|
4374
|
+
"#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs"
|
|
4334
4375
|
]
|
|
4335
4376
|
},
|
|
4336
4377
|
{
|
|
@@ -4340,6 +4381,13 @@
|
|
|
4340
4381
|
"test": [
|
|
4341
4382
|
{
|
|
4342
4383
|
"eval": "EVAL_TEALIUM_3"
|
|
4384
|
+
},
|
|
4385
|
+
{
|
|
4386
|
+
"eval": "EVAL_TEALIUM_DONOTSELL_CHECK"
|
|
4387
|
+
},
|
|
4388
|
+
{
|
|
4389
|
+
"visible": "#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs",
|
|
4390
|
+
"check": "none"
|
|
4343
4391
|
}
|
|
4344
4392
|
]
|
|
4345
4393
|
},
|
package/tests/tealium.spec.ts
CHANGED
|
@@ -2,5 +2,11 @@ import generateCMPTests from "../playwright/runner";
|
|
|
2
2
|
|
|
3
3
|
generateCMPTests('Tealium', [
|
|
4
4
|
// 'https://www.bahn.de/', // uses shadow DOM, see https://app.asana.com/0/1201844467387842/1202635343225979/f
|
|
5
|
+
'https://www.forcepoint.com/',
|
|
5
6
|
'https://www.lufthansa.com/de/en/homepage',
|
|
7
|
+
"http://www.tui.com/",
|
|
8
|
+
"http://www.minted.com/",
|
|
9
|
+
"http://help.brother-usa.com/",
|
|
10
|
+
"http://www.americangreetings.com/",
|
|
11
|
+
"http://www.hagerty.com/"
|
|
6
12
|
]);
|