@duckduckgo/autoconsent 14.75.0 → 14.77.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 +41 -0
- package/dist/addon-firefox/background.bundle.js +5 -3
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +25 -12
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/background.bundle.js +5 -3
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +25 -12
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +25 -12
- package/dist/autoconsent.esm.js +25 -12
- package/dist/autoconsent.extra.cjs.js +167 -160
- package/dist/autoconsent.extra.esm.js +167 -160
- package/dist/autoconsent.playwright.js +25 -12
- package/lib/cmps/onetrust.ts +25 -4
- package/lib/cmps/trustarc-frame.ts +1 -6
- package/lib/eval-snippets.ts +8 -3
- package/lib/filterlist-engine.ts +2 -2
- package/lib/heuristic-patterns.ts +2 -2
- package/package.json +1 -1
- package/rules/autoconsent/cookieconsent2.json +2 -2
- package/rules/autoconsent/cookieconsent3.json +14 -1
- package/rules/autoconsent/didomi.json +2 -2
- package/rules/autoconsent/kickstarter.json +34 -0
- package/rules/compact-rules.json +1 -1
- package/rules/filterlist.txt +198 -180
- package/rules/rules.json +1 -1
- package/tests/cookieconsent3.spec.ts +1 -1
- package/tests/didomi.spec.ts +11 -0
- package/tests/kickstarter.spec.ts +6 -0
- package/tests/onetrust.spec.ts +21 -0
- package/tests/trustarc.spec.ts +1 -1
- package/tests-wtr/heuristics/heuristics-utils.test.ts +9 -0
- package/tests-wtr/lifecycle/find-cmp.html +1 -0
- package/tests-wtr/lifecycle/find-cmp.ts +7 -0
package/dist/autoconsent.cjs.js
CHANGED
|
@@ -495,10 +495,12 @@ var snippets = {
|
|
|
495
495
|
return false;
|
|
496
496
|
},
|
|
497
497
|
EVAL_DIDOMI_TEST: () => {
|
|
498
|
-
|
|
499
|
-
|
|
498
|
+
const purposes = window.Didomi?.getCurrentUserStatus?.()?.purposes;
|
|
499
|
+
if (purposes) {
|
|
500
|
+
return Object.values(purposes).some((p) => !p.enabled);
|
|
500
501
|
}
|
|
501
|
-
|
|
502
|
+
const disabled = window.Didomi?.getUserConsentStatusForAll?.()?.purposes?.disabled;
|
|
503
|
+
return Array.isArray(disabled) && disabled.length > 0;
|
|
502
504
|
},
|
|
503
505
|
EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
|
|
504
506
|
EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
|
|
@@ -888,9 +890,9 @@ var DETECT_PATTERNS = [
|
|
|
888
890
|
/wijs alles af/gi
|
|
889
891
|
];
|
|
890
892
|
var REJECT_PATTERNS_ENGLISH = [
|
|
891
|
-
// e.g. "i reject cookies", "reject all", "reject all cookies", "reject cookies", "deny all", "deny all cookies", "refuse", "refuse all", "refuse cookies", "refuse all cookies", "deny", "reject all and close", "deny all and close", "reject non-essential cookies", "reject all non-essential cookies and continue", "reject optional cookies", "reject additional cookies", "reject targeting cookies", "reject marketing cookies", "reject analytics cookies", "reject tracking cookies", "reject advertising cookies", "reject all and close", "deny all and close"
|
|
893
|
+
// e.g. "i reject cookies", "reject all", "reject all cookies", "reject cookies", "deny all", "deny all cookies", "refuse", "refuse all", "refuse cookies", "refuse all cookies", "deny", "reject all and close", "deny all and close", "reject non-essential cookies", "reject all non-essential cookies and continue", "reject optional cookies", "reject additional cookies", "reject targeting cookies", "reject marketing cookies", "reject analytics cookies", "reject tracking cookies", "reject advertising cookies", "reject all and close", "deny all and close", "i reject all (except strictly necessary)"
|
|
892
894
|
// note that "reject and subscribe" and "reject and pay" are excluded
|
|
893
|
-
/^\s*(i)?\s*(reject|deny|refuse|decline|disable)\s*(all)?\s*(non-essential|optional|additional|targeting|analytics|marketing|unrequired|non-necessary|extra|tracking|advertising)?\s*(cookies)?\s*$/is,
|
|
895
|
+
/^\s*(i)?\s*(reject|deny|refuse|decline|disable)\s*(all)?\s*(non-essential|optional|additional|targeting|analytics|marketing|unrequired|non-necessary|extra|tracking|advertising)?\s*(cookies)?\s*(\(?\s*except\s+(strictly\s+)?(necessary|essential)\s*\)?)?\s*$/is,
|
|
894
896
|
// e.g. "i do not accept", "i do not accept cookies", "do not accept", "do not accept cookies"
|
|
895
897
|
/^\s*(i)?\s*do\s+not\s+accept\s*(cookies)?\s*$/is,
|
|
896
898
|
// e.g. "continue without accepting", "continue without agreeing", "continue without agreeing →"
|
|
@@ -2238,16 +2240,13 @@ var TrustArcFrame = class extends AutoConsentCMPBase {
|
|
|
2238
2240
|
return await waitFor(() => this.elementVisible(".switch span:first-child", "any"), 5, 1e3);
|
|
2239
2241
|
}
|
|
2240
2242
|
async optOut() {
|
|
2241
|
-
if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_TEST")) {
|
|
2242
|
-
return true;
|
|
2243
|
-
}
|
|
2244
2243
|
let timeout = 3e3;
|
|
2245
2244
|
if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_GTM")) {
|
|
2246
2245
|
timeout = 1500;
|
|
2247
2246
|
}
|
|
2248
2247
|
await waitFor(() => document.readyState === "complete", 20, 100);
|
|
2249
2248
|
await this.waitForElement(".mainContent[aria-hidden=false]", timeout);
|
|
2250
|
-
if (await this.click(".rejectAll")) {
|
|
2249
|
+
if (await this.click(".rejectAll,.declineAllButtonLower", true)) {
|
|
2251
2250
|
return true;
|
|
2252
2251
|
}
|
|
2253
2252
|
if (this.elementExists(".prefPanel")) {
|
|
@@ -2593,14 +2592,21 @@ var Onetrust = class extends AutoConsentCMPBase {
|
|
|
2593
2592
|
return false;
|
|
2594
2593
|
}
|
|
2595
2594
|
async detectCmp() {
|
|
2596
|
-
return this.elementExists("#onetrust-banner-sdk
|
|
2595
|
+
return this.elementExists("#onetrust-banner-sdk") || this.elementVisible("#onetrust-pc-sdk", "any");
|
|
2597
2596
|
}
|
|
2598
2597
|
async detectPopup() {
|
|
2599
2598
|
return this.elementVisible("#onetrust-banner-sdk,#onetrust-pc-sdk", "any");
|
|
2600
2599
|
}
|
|
2601
2600
|
async optOut() {
|
|
2602
|
-
|
|
2603
|
-
|
|
2601
|
+
await this.wait(500);
|
|
2602
|
+
if (this.elementVisible("#onetrust-reject-all-handler", "any")) {
|
|
2603
|
+
return await this.click("#onetrust-reject-all-handler");
|
|
2604
|
+
}
|
|
2605
|
+
if (this.elementVisible(".ot-pc-refuse-all-handler", "any")) {
|
|
2606
|
+
return await this.click(".ot-pc-refuse-all-handler");
|
|
2607
|
+
}
|
|
2608
|
+
if (this.elementVisible(".js-reject-cookies", "any")) {
|
|
2609
|
+
return await this.click(".js-reject-cookies");
|
|
2604
2610
|
}
|
|
2605
2611
|
if (this.elementVisible(".onetrust-close-btn-handler", "any")) {
|
|
2606
2612
|
const closeBtn = document.querySelector(".onetrust-close-btn-handler");
|
|
@@ -2609,6 +2615,13 @@ var Onetrust = class extends AutoConsentCMPBase {
|
|
|
2609
2615
|
if (rejectPatterns.some((pattern) => btnText.includes(pattern))) {
|
|
2610
2616
|
return await this.click(".onetrust-close-btn-handler");
|
|
2611
2617
|
}
|
|
2618
|
+
const banner = document.getElementById("onetrust-banner-sdk");
|
|
2619
|
+
const isCloseOnlyNotice = banner?.classList.contains("ot-close-btn-link") && !this.elementExists(
|
|
2620
|
+
"#onetrust-accept-btn-handler,#onetrust-reject-all-handler,#onetrust-pc-btn-handler,.ot-sdk-show-settings,button.js-cookie-settings"
|
|
2621
|
+
);
|
|
2622
|
+
if (isCloseOnlyNotice) {
|
|
2623
|
+
return await this.click(".onetrust-close-btn-handler");
|
|
2624
|
+
}
|
|
2612
2625
|
}
|
|
2613
2626
|
if (this.elementExists("#onetrust-pc-btn-handler")) {
|
|
2614
2627
|
await this.click("#onetrust-pc-btn-handler");
|
package/dist/autoconsent.esm.js
CHANGED
|
@@ -465,10 +465,12 @@ var snippets = {
|
|
|
465
465
|
return false;
|
|
466
466
|
},
|
|
467
467
|
EVAL_DIDOMI_TEST: () => {
|
|
468
|
-
|
|
469
|
-
|
|
468
|
+
const purposes = window.Didomi?.getCurrentUserStatus?.()?.purposes;
|
|
469
|
+
if (purposes) {
|
|
470
|
+
return Object.values(purposes).some((p) => !p.enabled);
|
|
470
471
|
}
|
|
471
|
-
|
|
472
|
+
const disabled = window.Didomi?.getUserConsentStatusForAll?.()?.purposes?.disabled;
|
|
473
|
+
return Array.isArray(disabled) && disabled.length > 0;
|
|
472
474
|
},
|
|
473
475
|
EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
|
|
474
476
|
EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
|
|
@@ -858,9 +860,9 @@ var DETECT_PATTERNS = [
|
|
|
858
860
|
/wijs alles af/gi
|
|
859
861
|
];
|
|
860
862
|
var REJECT_PATTERNS_ENGLISH = [
|
|
861
|
-
// e.g. "i reject cookies", "reject all", "reject all cookies", "reject cookies", "deny all", "deny all cookies", "refuse", "refuse all", "refuse cookies", "refuse all cookies", "deny", "reject all and close", "deny all and close", "reject non-essential cookies", "reject all non-essential cookies and continue", "reject optional cookies", "reject additional cookies", "reject targeting cookies", "reject marketing cookies", "reject analytics cookies", "reject tracking cookies", "reject advertising cookies", "reject all and close", "deny all and close"
|
|
863
|
+
// e.g. "i reject cookies", "reject all", "reject all cookies", "reject cookies", "deny all", "deny all cookies", "refuse", "refuse all", "refuse cookies", "refuse all cookies", "deny", "reject all and close", "deny all and close", "reject non-essential cookies", "reject all non-essential cookies and continue", "reject optional cookies", "reject additional cookies", "reject targeting cookies", "reject marketing cookies", "reject analytics cookies", "reject tracking cookies", "reject advertising cookies", "reject all and close", "deny all and close", "i reject all (except strictly necessary)"
|
|
862
864
|
// note that "reject and subscribe" and "reject and pay" are excluded
|
|
863
|
-
/^\s*(i)?\s*(reject|deny|refuse|decline|disable)\s*(all)?\s*(non-essential|optional|additional|targeting|analytics|marketing|unrequired|non-necessary|extra|tracking|advertising)?\s*(cookies)?\s*$/is,
|
|
865
|
+
/^\s*(i)?\s*(reject|deny|refuse|decline|disable)\s*(all)?\s*(non-essential|optional|additional|targeting|analytics|marketing|unrequired|non-necessary|extra|tracking|advertising)?\s*(cookies)?\s*(\(?\s*except\s+(strictly\s+)?(necessary|essential)\s*\)?)?\s*$/is,
|
|
864
866
|
// e.g. "i do not accept", "i do not accept cookies", "do not accept", "do not accept cookies"
|
|
865
867
|
/^\s*(i)?\s*do\s+not\s+accept\s*(cookies)?\s*$/is,
|
|
866
868
|
// e.g. "continue without accepting", "continue without agreeing", "continue without agreeing →"
|
|
@@ -2208,16 +2210,13 @@ var TrustArcFrame = class extends AutoConsentCMPBase {
|
|
|
2208
2210
|
return await waitFor(() => this.elementVisible(".switch span:first-child", "any"), 5, 1e3);
|
|
2209
2211
|
}
|
|
2210
2212
|
async optOut() {
|
|
2211
|
-
if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_TEST")) {
|
|
2212
|
-
return true;
|
|
2213
|
-
}
|
|
2214
2213
|
let timeout = 3e3;
|
|
2215
2214
|
if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_GTM")) {
|
|
2216
2215
|
timeout = 1500;
|
|
2217
2216
|
}
|
|
2218
2217
|
await waitFor(() => document.readyState === "complete", 20, 100);
|
|
2219
2218
|
await this.waitForElement(".mainContent[aria-hidden=false]", timeout);
|
|
2220
|
-
if (await this.click(".rejectAll")) {
|
|
2219
|
+
if (await this.click(".rejectAll,.declineAllButtonLower", true)) {
|
|
2221
2220
|
return true;
|
|
2222
2221
|
}
|
|
2223
2222
|
if (this.elementExists(".prefPanel")) {
|
|
@@ -2563,14 +2562,21 @@ var Onetrust = class extends AutoConsentCMPBase {
|
|
|
2563
2562
|
return false;
|
|
2564
2563
|
}
|
|
2565
2564
|
async detectCmp() {
|
|
2566
|
-
return this.elementExists("#onetrust-banner-sdk
|
|
2565
|
+
return this.elementExists("#onetrust-banner-sdk") || this.elementVisible("#onetrust-pc-sdk", "any");
|
|
2567
2566
|
}
|
|
2568
2567
|
async detectPopup() {
|
|
2569
2568
|
return this.elementVisible("#onetrust-banner-sdk,#onetrust-pc-sdk", "any");
|
|
2570
2569
|
}
|
|
2571
2570
|
async optOut() {
|
|
2572
|
-
|
|
2573
|
-
|
|
2571
|
+
await this.wait(500);
|
|
2572
|
+
if (this.elementVisible("#onetrust-reject-all-handler", "any")) {
|
|
2573
|
+
return await this.click("#onetrust-reject-all-handler");
|
|
2574
|
+
}
|
|
2575
|
+
if (this.elementVisible(".ot-pc-refuse-all-handler", "any")) {
|
|
2576
|
+
return await this.click(".ot-pc-refuse-all-handler");
|
|
2577
|
+
}
|
|
2578
|
+
if (this.elementVisible(".js-reject-cookies", "any")) {
|
|
2579
|
+
return await this.click(".js-reject-cookies");
|
|
2574
2580
|
}
|
|
2575
2581
|
if (this.elementVisible(".onetrust-close-btn-handler", "any")) {
|
|
2576
2582
|
const closeBtn = document.querySelector(".onetrust-close-btn-handler");
|
|
@@ -2579,6 +2585,13 @@ var Onetrust = class extends AutoConsentCMPBase {
|
|
|
2579
2585
|
if (rejectPatterns.some((pattern) => btnText.includes(pattern))) {
|
|
2580
2586
|
return await this.click(".onetrust-close-btn-handler");
|
|
2581
2587
|
}
|
|
2588
|
+
const banner = document.getElementById("onetrust-banner-sdk");
|
|
2589
|
+
const isCloseOnlyNotice = banner?.classList.contains("ot-close-btn-link") && !this.elementExists(
|
|
2590
|
+
"#onetrust-accept-btn-handler,#onetrust-reject-all-handler,#onetrust-pc-btn-handler,.ot-sdk-show-settings,button.js-cookie-settings"
|
|
2591
|
+
);
|
|
2592
|
+
if (isCloseOnlyNotice) {
|
|
2593
|
+
return await this.click(".onetrust-close-btn-handler");
|
|
2594
|
+
}
|
|
2582
2595
|
}
|
|
2583
2596
|
if (this.elementExists("#onetrust-pc-btn-handler")) {
|
|
2584
2597
|
await this.click("#onetrust-pc-btn-handler");
|