@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
|
@@ -460,10 +460,12 @@
|
|
|
460
460
|
return false;
|
|
461
461
|
},
|
|
462
462
|
EVAL_DIDOMI_TEST: () => {
|
|
463
|
-
|
|
464
|
-
|
|
463
|
+
const purposes = window.Didomi?.getCurrentUserStatus?.()?.purposes;
|
|
464
|
+
if (purposes) {
|
|
465
|
+
return Object.values(purposes).some((p) => !p.enabled);
|
|
465
466
|
}
|
|
466
|
-
|
|
467
|
+
const disabled = window.Didomi?.getUserConsentStatusForAll?.()?.purposes?.disabled;
|
|
468
|
+
return Array.isArray(disabled) && disabled.length > 0;
|
|
467
469
|
},
|
|
468
470
|
EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
|
|
469
471
|
EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
|
|
@@ -853,9 +855,9 @@
|
|
|
853
855
|
/wijs alles af/gi
|
|
854
856
|
];
|
|
855
857
|
var REJECT_PATTERNS_ENGLISH = [
|
|
856
|
-
// 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"
|
|
858
|
+
// 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)"
|
|
857
859
|
// note that "reject and subscribe" and "reject and pay" are excluded
|
|
858
|
-
/^\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,
|
|
860
|
+
/^\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,
|
|
859
861
|
// e.g. "i do not accept", "i do not accept cookies", "do not accept", "do not accept cookies"
|
|
860
862
|
/^\s*(i)?\s*do\s+not\s+accept\s*(cookies)?\s*$/is,
|
|
861
863
|
// e.g. "continue without accepting", "continue without agreeing", "continue without agreeing →"
|
|
@@ -2203,16 +2205,13 @@
|
|
|
2203
2205
|
return await waitFor(() => this.elementVisible(".switch span:first-child", "any"), 5, 1e3);
|
|
2204
2206
|
}
|
|
2205
2207
|
async optOut() {
|
|
2206
|
-
if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_TEST")) {
|
|
2207
|
-
return true;
|
|
2208
|
-
}
|
|
2209
2208
|
let timeout = 3e3;
|
|
2210
2209
|
if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_GTM")) {
|
|
2211
2210
|
timeout = 1500;
|
|
2212
2211
|
}
|
|
2213
2212
|
await waitFor(() => document.readyState === "complete", 20, 100);
|
|
2214
2213
|
await this.waitForElement(".mainContent[aria-hidden=false]", timeout);
|
|
2215
|
-
if (await this.click(".rejectAll")) {
|
|
2214
|
+
if (await this.click(".rejectAll,.declineAllButtonLower", true)) {
|
|
2216
2215
|
return true;
|
|
2217
2216
|
}
|
|
2218
2217
|
if (this.elementExists(".prefPanel")) {
|
|
@@ -2558,14 +2557,21 @@
|
|
|
2558
2557
|
return false;
|
|
2559
2558
|
}
|
|
2560
2559
|
async detectCmp() {
|
|
2561
|
-
return this.elementExists("#onetrust-banner-sdk
|
|
2560
|
+
return this.elementExists("#onetrust-banner-sdk") || this.elementVisible("#onetrust-pc-sdk", "any");
|
|
2562
2561
|
}
|
|
2563
2562
|
async detectPopup() {
|
|
2564
2563
|
return this.elementVisible("#onetrust-banner-sdk,#onetrust-pc-sdk", "any");
|
|
2565
2564
|
}
|
|
2566
2565
|
async optOut() {
|
|
2567
|
-
|
|
2568
|
-
|
|
2566
|
+
await this.wait(500);
|
|
2567
|
+
if (this.elementVisible("#onetrust-reject-all-handler", "any")) {
|
|
2568
|
+
return await this.click("#onetrust-reject-all-handler");
|
|
2569
|
+
}
|
|
2570
|
+
if (this.elementVisible(".ot-pc-refuse-all-handler", "any")) {
|
|
2571
|
+
return await this.click(".ot-pc-refuse-all-handler");
|
|
2572
|
+
}
|
|
2573
|
+
if (this.elementVisible(".js-reject-cookies", "any")) {
|
|
2574
|
+
return await this.click(".js-reject-cookies");
|
|
2569
2575
|
}
|
|
2570
2576
|
if (this.elementVisible(".onetrust-close-btn-handler", "any")) {
|
|
2571
2577
|
const closeBtn = document.querySelector(".onetrust-close-btn-handler");
|
|
@@ -2574,6 +2580,13 @@
|
|
|
2574
2580
|
if (rejectPatterns.some((pattern) => btnText.includes(pattern))) {
|
|
2575
2581
|
return await this.click(".onetrust-close-btn-handler");
|
|
2576
2582
|
}
|
|
2583
|
+
const banner = document.getElementById("onetrust-banner-sdk");
|
|
2584
|
+
const isCloseOnlyNotice = banner?.classList.contains("ot-close-btn-link") && !this.elementExists(
|
|
2585
|
+
"#onetrust-accept-btn-handler,#onetrust-reject-all-handler,#onetrust-pc-btn-handler,.ot-sdk-show-settings,button.js-cookie-settings"
|
|
2586
|
+
);
|
|
2587
|
+
if (isCloseOnlyNotice) {
|
|
2588
|
+
return await this.click(".onetrust-close-btn-handler");
|
|
2589
|
+
}
|
|
2577
2590
|
}
|
|
2578
2591
|
if (this.elementExists("#onetrust-pc-btn-handler")) {
|
|
2579
2592
|
await this.click("#onetrust-pc-btn-handler");
|