@duckduckgo/autoconsent 1.0.6 → 2.0.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/.eslintrc.cjs +14 -0
- package/.vscode/settings.json +7 -0
- package/Jenkinsfile +68 -39
- package/api.md +104 -0
- package/dist/autoconsent.cjs.js +1 -1371
- package/dist/autoconsent.esm.js +1 -1363
- package/dist/autoconsent.playwright.js +1 -0
- package/dist/autoconsent.standalone.js +1 -0
- package/lib/cmps/all.ts +15 -10
- package/lib/cmps/base.ts +91 -91
- package/lib/cmps/consentmanager.ts +31 -19
- package/lib/cmps/consentomatic.ts +89 -0
- package/lib/cmps/cookiebot.ts +62 -53
- package/lib/cmps/evidon.ts +29 -18
- package/lib/cmps/onetrust.ts +37 -19
- package/lib/cmps/sourcepoint-frame.ts +102 -0
- package/lib/cmps/sourcepoint-top.ts +47 -0
- package/lib/cmps/trustarc-frame.ts +115 -0
- package/lib/cmps/trustarc-top.ts +91 -0
- package/lib/consentomatic/index.ts +233 -70
- package/lib/{web/consentomatic → consentomatic}/tools.ts +0 -0
- package/lib/eval-handler.ts +58 -0
- package/lib/index.ts +0 -2
- package/lib/messages.ts +100 -0
- package/lib/rule-executors.ts +108 -0
- package/lib/rules.ts +82 -0
- package/lib/types.ts +35 -0
- package/lib/utils.ts +64 -0
- package/lib/web.ts +283 -74
- package/package.json +17 -14
- package/playwright/content.ts +27 -0
- package/playwright/runner.ts +131 -0
- package/playwright/standalone.ts +36 -0
- package/playwright.config.ts +7 -0
- package/readme.md +57 -47
- package/rollup.config.js +23 -15
- package/rules/autoconsent/192.json +17 -0
- package/rules/autoconsent/ausopen.json +7 -0
- package/rules/autoconsent/aws-amazon.json +1 -1
- package/rules/autoconsent/baden-wuerttemberg-de.json +7 -3
- package/rules/autoconsent/bing.json +14 -0
- package/rules/autoconsent/bundesregierung-de.json +6 -2
- package/rules/autoconsent/cc-banner.json +0 -1
- package/rules/autoconsent/cookie-notice.json +0 -1
- package/rules/autoconsent/cookieconsent.json +5 -6
- package/rules/autoconsent/destatis-de.json +0 -1
- package/rules/autoconsent/dunelm.json +18 -0
- package/rules/autoconsent/etsy.json +3 -2
- package/rules/autoconsent/eu-cookie-compliance.json +0 -1
- package/rules/autoconsent/gov-uk.json +10 -0
- package/rules/autoconsent/hl-co-uk.json +8 -9
- package/rules/autoconsent/johnlewis.json +5 -2
- package/rules/autoconsent/marksandspencer.json +7 -0
- package/rules/autoconsent/notice-cookie.json +0 -1
- package/rules/autoconsent/osano.json +0 -1
- package/rules/autoconsent/{paypal-de.json → paypal.json} +6 -2
- package/rules/autoconsent/tealium.json +4 -5
- package/rules/autoconsent/uswitch.json +8 -0
- package/rules/autoconsent/waitrose.json +28 -0
- package/rules/autoconsent/wetransfer.json +7 -0
- package/rules/rules.json +314 -39
- package/tests/192.spec.ts +7 -0
- package/tests/arzt-auskunft.spec.ts +1 -1
- package/tests/asus.spec.ts +1 -1
- package/tests/ausopen.spec.ts +7 -0
- package/tests/aws.amazon.spec.ts +1 -1
- package/tests/baden-wuerttemberg.spec.ts +1 -1
- package/tests/borlabs.spec.ts +1 -1
- package/tests/bundesregierung.spec.ts +5 -2
- package/tests/ccbanner.spec.ts +1 -1
- package/tests/consentmanager.spec.ts +3 -3
- package/tests/cookiebot.spec.ts +8 -1
- package/tests/cookieconsent.spec.ts +1 -1
- package/tests/cookielawinfo.spec.ts +1 -1
- package/tests/cookienotice.spec.ts +1 -1
- package/tests/corona-in-zahlen.spec.ts +1 -1
- package/tests/deepl.spec.ts +1 -1
- package/tests/destatis.spec.ts +1 -1
- package/tests/didomi.spec.ts +6 -2
- package/tests/drupal.spec.ts +8 -0
- package/tests/dunelm.spec.ts +7 -0
- package/tests/etsy.spec.ts +1 -1
- package/tests/eu-cookie-compliance-banner.spec.ts +1 -1
- package/tests/evidon.spec.ts +1 -1
- package/tests/fundingchoices.spec.ts +2 -1
- package/tests/gov-uk.spec.ts +9 -0
- package/tests/hl-co-uk.spec.ts +1 -1
- package/tests/hubspot.spec.ts +1 -1
- package/tests/ionos.spec.ts +1 -1
- package/tests/johnlewis.spec.ts +2 -2
- package/tests/klaro.spec.ts +1 -1
- package/tests/marksandspencer.spec.ts +7 -0
- package/tests/mediamarkt.spec.ts +1 -1
- package/tests/metoffice-gov-uk.spec.ts +1 -1
- package/tests/microsoft.spec.ts +1 -1
- package/tests/moneysavingexpert.spec.ts +1 -1
- package/tests/motor-talk.spec.ts +1 -1
- package/tests/national-lottery.spec.ts +1 -1
- package/tests/netflix.spec.ts +1 -1
- package/tests/nhs.spec.ts +1 -1
- package/tests/notice-cookie.spec.ts +1 -1
- package/tests/obi.spec.ts +1 -1
- package/tests/oil.spec.ts +1 -1
- package/tests/onetrust.spec.ts +10 -1
- package/tests/osano.spec.ts +1 -1
- package/tests/otto.spec.ts +1 -1
- package/tests/paypal.spec.ts +8 -6
- package/tests/quantcast.spec.ts +4 -1
- package/tests/snigel.spec.ts +1 -1
- package/tests/sourcepoint.spec.ts +8 -8
- package/tests/springer.spec.ts +1 -1
- package/tests/steampowered.spec.ts +1 -1
- package/tests/tealium.spec.ts +1 -1
- package/tests/testcmp.spec.ts +1 -1
- package/tests/thalia.spec.ts +1 -1
- package/tests/thefreedictionary.spec.ts +1 -1
- package/tests/trustarc.spec.ts +25 -3
- package/tests/usercentrics-1.spec.ts +1 -1
- package/tests/uswitch.spec.ts +7 -0
- package/tests/vodafone.spec.ts +1 -1
- package/tests/waitrose.spec.ts +7 -0
- package/tests/wetransfer.spec.ts +7 -0
- package/tests/wordpressgdpr.spec.ts +1 -1
- package/tests/xing.spec.ts +1 -1
- package/tsconfig.json +2 -2
- package/.eslintrc +0 -12
- package/cosmetics/rules.json +0 -110
- package/dist/autoconsent.puppet.js +0 -1072
- package/lib/cmps/all.js +0 -19
- package/lib/cmps/base.js +0 -174
- package/lib/cmps/consentmanager.js +0 -31
- package/lib/cmps/cookiebot.js +0 -73
- package/lib/cmps/evidon.js +0 -26
- package/lib/cmps/onetrust.js +0 -32
- package/lib/cmps/sourcepoint.js +0 -82
- package/lib/cmps/sourcepoint.ts +0 -95
- package/lib/cmps/trustarc.js +0 -106
- package/lib/cmps/trustarc.ts +0 -147
- package/lib/config.js +0 -1
- package/lib/consentomatic/index.js +0 -52
- package/lib/detector.js +0 -33
- package/lib/detector.ts +0 -34
- package/lib/hider.js +0 -13
- package/lib/hider.ts +0 -16
- package/lib/index.js +0 -4
- package/lib/messages.d.ts +0 -61
- package/lib/node.js +0 -35
- package/lib/node.ts +0 -43
- package/lib/puppet/tab.js +0 -121
- package/lib/puppet/tab.ts +0 -146
- package/lib/rules.d.ts +0 -80
- package/lib/tabwrapper.js +0 -67
- package/lib/tabwrapper.ts +0 -74
- package/lib/types.d.ts +0 -61
- package/lib/web/consentomatic/index.js +0 -188
- package/lib/web/consentomatic/index.ts +0 -249
- package/lib/web/consentomatic/tools.js +0 -177
- package/lib/web/content-utils.js +0 -29
- package/lib/web/content-utils.ts +0 -31
- package/lib/web/content.js +0 -79
- package/lib/web/content.ts +0 -71
- package/lib/web/tab.js +0 -112
- package/lib/web/tab.ts +0 -178
- package/lib/web.js +0 -95
- package/tests/runner.ts +0 -61
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"name": "hl.co.uk",
|
|
3
|
+
"prehideSelectors": [".cookieModalContent", "#cookie-banner-overlay"],
|
|
4
4
|
"detectCmp": [{ "exists": "#cookie-banner-overlay" }],
|
|
5
5
|
"detectPopup": [{ "exists": "#cookie-banner-overlay" }],
|
|
6
6
|
"optIn": [{ "click": "#acceptCookieButton" }],
|
|
@@ -12,19 +12,18 @@
|
|
|
12
12
|
"hide": [".cookieSettingsModal"]
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
"
|
|
15
|
+
"waitFor": "#AOCookieToggle"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"click": "#AOCookieToggle"
|
|
18
|
+
"click": "#AOCookieToggle[aria-pressed=true]",
|
|
19
|
+
"optional": true
|
|
19
20
|
},
|
|
20
21
|
{
|
|
21
|
-
"
|
|
22
|
+
"waitFor": "#TPCookieToggle"
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
|
-
"click": "#TPCookieToggle"
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
"eval": "document.querySelector('#TPCookieToggle').getAttribute('aria-pressed') === 'false'"
|
|
25
|
+
"click": "#TPCookieToggle[aria-pressed=true]",
|
|
26
|
+
"optional": true
|
|
28
27
|
},
|
|
29
28
|
{
|
|
30
29
|
"click": "#updateCookieButton"
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
"optOut": [
|
|
7
7
|
{"click": "button[data-test^=manage-cookies]"},
|
|
8
8
|
{"wait": "500"},
|
|
9
|
-
{
|
|
10
|
-
|
|
9
|
+
{
|
|
10
|
+
"click": "label[data-test^=toggle][class*=checked]:not([class*=disabled])",
|
|
11
|
+
"all": true,
|
|
12
|
+
"optional": true
|
|
13
|
+
},
|
|
11
14
|
{"click": "button[data-test=save-preferences]"}
|
|
12
15
|
],
|
|
13
16
|
"optIn": [{ "click": "button[data-test=allow-all]"}]
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "paypal.
|
|
2
|
+
"name": "paypal.com",
|
|
3
3
|
"prehideSelectors": ["#gdprCookieBanner"],
|
|
4
4
|
"detectCmp": [{ "exists": "#gdprCookieBanner"}],
|
|
5
5
|
"detectPopup": [{ "visible": "#gdprCookieContent_wrapper" }],
|
|
6
6
|
"optIn": [{ "click": "#acceptAllButton" }],
|
|
7
7
|
"optOut": [
|
|
8
|
+
{
|
|
9
|
+
"wait": 200
|
|
10
|
+
},
|
|
8
11
|
{
|
|
9
12
|
"click": ".gdprCookieBanner_decline-button"
|
|
10
13
|
}
|
|
11
|
-
]
|
|
14
|
+
],
|
|
15
|
+
"test": [{"eval": "document.cookie.includes('cookie_prefs') === true"}]
|
|
12
16
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Tealium",
|
|
3
3
|
"prehideSelectors": ["#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#consent-layer"],
|
|
4
|
-
"
|
|
5
|
-
"detectCmp": [{ "exists": "#__tealiumGDPRecModal" }, { "eval": "window.utag && typeof utag.gdpr === 'object'" }],
|
|
4
|
+
"detectCmp": [{ "visible": "#__tealiumGDPRecModal" }, { "eval": "typeof window.utag !== 'undefined' && typeof utag.gdpr === 'object'" }],
|
|
6
5
|
"detectPopup": [{ "visible": "#__tealiumGDPRecModal" }],
|
|
7
6
|
"optOut": [
|
|
8
7
|
{ "hide": ["#__tealiumGDPRecModal", "#__tealiumGDPRcpPrefs", "#consent-layer"] },
|
|
9
|
-
{ "
|
|
8
|
+
{ "waitForThenClick": "#cm-acceptNone,.js-accept-essential-cookies", "timeout": 1000 },
|
|
9
|
+
{ "eval": "utag.gdpr.setConsentValue(false) || true" }
|
|
10
10
|
],
|
|
11
11
|
"optIn": [
|
|
12
12
|
{ "hide": ["#__tealiumGDPRecModal"] },
|
|
13
|
-
{ "eval": "utag.gdpr.setConsentValue(true)" }
|
|
13
|
+
{ "eval": "utag.gdpr.setConsentValue(true) || true" }
|
|
14
14
|
],
|
|
15
15
|
"test": [
|
|
16
16
|
{ "eval": "utag.gdpr.getConsentState() !== 1" }
|
|
17
17
|
]
|
|
18
18
|
}
|
|
19
|
-
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "uswitch.com",
|
|
3
|
+
"prehideSelectors": ["#cookie-banner-wrapper"],
|
|
4
|
+
"detectCmp": [{ "exists": "#cookie-banner-wrapper"}],
|
|
5
|
+
"detectPopup": [{ "visible": "#cookie-banner-wrapper" }],
|
|
6
|
+
"optIn": [{ "click": "#cookie_banner_accept_mobile" }],
|
|
7
|
+
"optOut": [{ "click": "#cookie_banner_save"}]
|
|
8
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "waitrose.com",
|
|
3
|
+
"prehideSelectors": [
|
|
4
|
+
"div[aria-labelledby=CookieAlertModalHeading]",
|
|
5
|
+
"section[data-test=initial-waitrose-cookie-consent-banner]",
|
|
6
|
+
"section[data-test=cookie-consent-modal]"
|
|
7
|
+
],
|
|
8
|
+
"detectCmp": [{ "exists": "section[data-test=initial-waitrose-cookie-consent-banner]"}],
|
|
9
|
+
"detectPopup": [{ "visible": "section[data-test=initial-waitrose-cookie-consent-banner]" }],
|
|
10
|
+
"optIn": [{ "click": "button[data-test=accept-all]" }],
|
|
11
|
+
"optOut": [
|
|
12
|
+
{
|
|
13
|
+
"click": "button[data-test=manage-cookies]"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"wait": 200
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"eval": "Array.from(document.querySelectorAll('label[id$=cookies-deny-label]')).forEach(e => e.click()) || true"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"click": "button[data-test=submit]"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"test": [
|
|
26
|
+
{"eval": "document.cookie.includes('wtr_cookies_advertising=0') && document.cookie.includes('wtr_cookies_analytics=0')"}
|
|
27
|
+
]
|
|
28
|
+
}
|