@duckduckgo/autoconsent 7.1.0 → 8.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 +37 -0
- package/Jenkinsfile +20 -37
- package/data/coverage.json +507 -531
- package/dist/addon-firefox/background.bundle.js +1 -0
- package/dist/addon-firefox/content.bundle.js +12 -15
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/rules.json +127 -184
- package/dist/addon-mv3/background.bundle.js +1 -0
- package/dist/addon-mv3/content.bundle.js +12 -15
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/rules.json +127 -184
- package/dist/autoconsent.cjs.js +12 -15
- package/dist/autoconsent.esm.js +12 -15
- package/dist/autoconsent.playwright.js +1 -1
- package/lib/cmps/cookiebot.ts +1 -4
- package/lib/cmps/evidon.ts +1 -1
- package/lib/cmps/trustarc-top.ts +1 -1
- package/lib/eval-snippets.ts +1 -0
- package/lib/rule-executors.ts +4 -4
- package/lib/rules.ts +1 -6
- package/lib/utils.ts +3 -5
- package/lib/web.ts +1 -1
- package/package.json +3 -2
- package/playwright/runner.ts +1 -0
- package/playwright.config.ts +0 -2
- package/readme.md +37 -28
- package/rules/autoconsent/1password-com.json +1 -1
- package/rules/autoconsent/agolde-com.json +1 -1
- package/rules/autoconsent/altium-com.json +1 -1
- package/rules/autoconsent/aquasana-com.json +1 -1
- package/rules/autoconsent/athlinks-com.json +1 -1
- package/rules/autoconsent/ausopen.json +1 -1
- package/rules/autoconsent/baden-wuerttemberg-de.json +1 -1
- package/rules/autoconsent/bbb.json +1 -1
- package/rules/autoconsent/burpee-com.json +1 -1
- package/rules/autoconsent/cc-banner.json +1 -1
- package/rules/autoconsent/clustrmaps-com.json +1 -1
- package/rules/autoconsent/complianz-notice.json +1 -1
- package/rules/autoconsent/cookie-law-info.json +1 -1
- package/rules/autoconsent/cookie-notice.json +1 -1
- package/rules/autoconsent/cookieinformation.json +1 -1
- package/rules/autoconsent/cookieyes.json +1 -1
- package/rules/autoconsent/crossfit-com.json +1 -1
- package/rules/autoconsent/dailymotion-us.json +1 -1
- package/rules/autoconsent/delta-com.json +1 -1
- package/rules/autoconsent/dsgvo.json +1 -1
- package/rules/autoconsent/eu-cookie-compliance.json +1 -1
- package/rules/autoconsent/eu-cookie-law.json +1 -1
- package/rules/autoconsent/geeks-for-geeks.json +1 -1
- package/rules/autoconsent/generic-cosmetic.json +1 -1
- package/rules/autoconsent/hema-com.json +21 -0
- package/rules/autoconsent/hl-co-uk.json +1 -1
- package/rules/autoconsent/indeed-com.json +1 -1
- package/rules/autoconsent/ing-de.json +18 -0
- package/rules/autoconsent/itopvpn-com.json +1 -1
- package/rules/autoconsent/jquery-cookiebar.json +1 -1
- package/rules/autoconsent/macpaw-com.json +1 -1
- package/rules/autoconsent/marksandspencer.json +1 -1
- package/rules/autoconsent/midway-usa.json +1 -1
- package/rules/autoconsent/moove.json +1 -1
- package/rules/autoconsent/nba-com.json +1 -1
- package/rules/autoconsent/netflix-de.json +1 -1
- package/rules/autoconsent/notice-cookie.json +1 -1
- package/rules/autoconsent/nrk-no.json +1 -1
- package/rules/autoconsent/osano.json +1 -1
- package/rules/autoconsent/pinetools-com.json +1 -1
- package/rules/autoconsent/pmc-cmp.json +1 -1
- package/rules/autoconsent/pornhub.json +1 -1
- package/rules/autoconsent/pornpics.json +1 -1
- package/rules/autoconsent/primebox.json +1 -1
- package/rules/autoconsent/samsung-com.json +1 -1
- package/rules/autoconsent/similarweb-com.json +1 -1
- package/rules/autoconsent/takealot-com.json +1 -1
- package/rules/autoconsent/tealium.json +2 -2
- package/rules/autoconsent/testcmp-cosmetic.json +1 -1
- package/rules/autoconsent/tidbits-com.json +1 -1
- package/rules/autoconsent/tractor-supply.json +1 -1
- package/rules/autoconsent/trader-joes-com.json +1 -1
- package/rules/autoconsent/true-car.json +1 -1
- package/rules/autoconsent/tumblr-com.json +1 -1
- package/rules/autoconsent/twitch.json +1 -1
- package/rules/autoconsent/uk-cookie-consent.json +1 -1
- package/rules/autoconsent/urbanarmorgear-com.json +1 -1
- package/rules/autoconsent/whitepages.json +1 -1
- package/rules/autoconsent/wpcc.json +1 -1
- package/rules/autoconsent/xhamster-us.json +1 -1
- package/rules/autoconsent/xnxx-com.json +1 -1
- package/rules/autoconsent/youporn.json +1 -1
- package/rules/rules.json +127 -184
- package/tests/_sample-test.spec.ts +16 -0
- package/tests/hema.spec.ts +7 -0
package/dist/autoconsent.cjs.js
CHANGED
|
@@ -438,14 +438,12 @@ function getStyleElement(styleOverrideElementId = "autoconsent-css-rules") {
|
|
|
438
438
|
return css;
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
function hideElements(styleEl,
|
|
441
|
+
function hideElements(styleEl, selector, method = "display") {
|
|
442
442
|
const hidingSnippet = method === "opacity" ? `opacity: 0` : `display: none`;
|
|
443
|
-
const rule = `${
|
|
444
|
-
","
|
|
445
|
-
)} { ${hidingSnippet} !important; z-index: -1 !important; pointer-events: none !important; } `;
|
|
443
|
+
const rule = `${selector} { ${hidingSnippet} !important; z-index: -1 !important; pointer-events: none !important; } `;
|
|
446
444
|
if (styleEl instanceof HTMLStyleElement) {
|
|
447
445
|
styleEl.innerText += rule;
|
|
448
|
-
return
|
|
446
|
+
return selector.length > 0;
|
|
449
447
|
}
|
|
450
448
|
return false;
|
|
451
449
|
}
|
|
@@ -537,14 +535,14 @@ function wait(ms) {
|
|
|
537
535
|
}, ms);
|
|
538
536
|
});
|
|
539
537
|
}
|
|
540
|
-
function hide(
|
|
538
|
+
function hide(selector, method) {
|
|
541
539
|
const styleEl = getStyleElement();
|
|
542
|
-
return hideElements(styleEl,
|
|
540
|
+
return hideElements(styleEl, selector, method);
|
|
543
541
|
}
|
|
544
|
-
function prehide(
|
|
542
|
+
function prehide(selector) {
|
|
545
543
|
const styleEl = getStyleElement("autoconsent-prehide");
|
|
546
544
|
enableLogs && console.log("[prehide]", styleEl, location.href);
|
|
547
|
-
return hideElements(styleEl,
|
|
545
|
+
return hideElements(styleEl, selector, "opacity");
|
|
548
546
|
}
|
|
549
547
|
function undoPrehide() {
|
|
550
548
|
const existingElement = getStyleElement("autoconsent-prehide");
|
|
@@ -704,6 +702,7 @@ var snippets = {
|
|
|
704
702
|
EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
|
|
705
703
|
EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
|
|
706
704
|
EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
|
|
705
|
+
EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
|
|
707
706
|
EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
|
|
708
707
|
if (x.checked)
|
|
709
708
|
x.click();
|
|
@@ -1097,7 +1096,7 @@ var TrustArcTop = class extends AutoConsentCMPBase {
|
|
|
1097
1096
|
}
|
|
1098
1097
|
hideElements(
|
|
1099
1098
|
getStyleElement(),
|
|
1100
|
-
|
|
1099
|
+
`.truste_popframe, .truste_overlay, .truste_box_overlay, ${bannerContainer}`
|
|
1101
1100
|
);
|
|
1102
1101
|
click(cookieSettingsButton);
|
|
1103
1102
|
setTimeout(() => {
|
|
@@ -1222,9 +1221,7 @@ var Cookiebot = class extends AutoConsentCMPBase {
|
|
|
1222
1221
|
return await this.mainWorldEval("EVAL_COOKIEBOT_1");
|
|
1223
1222
|
}
|
|
1224
1223
|
async detectPopup() {
|
|
1225
|
-
return
|
|
1226
|
-
return this.mainWorldEval("EVAL_COOKIEBOT_2");
|
|
1227
|
-
}, 10, 500);
|
|
1224
|
+
return this.mainWorldEval("EVAL_COOKIEBOT_2");
|
|
1228
1225
|
}
|
|
1229
1226
|
async optOut() {
|
|
1230
1227
|
await wait(500);
|
|
@@ -1448,7 +1445,7 @@ var Evidon = class extends AutoConsentCMPBase {
|
|
|
1448
1445
|
if (click("#_evidon-decline-button")) {
|
|
1449
1446
|
return true;
|
|
1450
1447
|
}
|
|
1451
|
-
hideElements(getStyleElement(),
|
|
1448
|
+
hideElements(getStyleElement(), "#evidon-prefdiag-overlay,#evidon-prefdiag-background");
|
|
1452
1449
|
click("#_evidon-option-button");
|
|
1453
1450
|
await waitForElement("#evidon-prefdiag-overlay", 5e3);
|
|
1454
1451
|
click("#evidon-prefdiag-decline");
|
|
@@ -2121,7 +2118,7 @@ var AutoConsent = class {
|
|
|
2121
2118
|
this.undoPrehide();
|
|
2122
2119
|
}
|
|
2123
2120
|
}, this.config.prehideTimeout || 2e3);
|
|
2124
|
-
return prehide(selectors);
|
|
2121
|
+
return prehide(selectors.join(","));
|
|
2125
2122
|
}
|
|
2126
2123
|
undoPrehide() {
|
|
2127
2124
|
this.updateState({ prehideOn: false });
|
package/dist/autoconsent.esm.js
CHANGED
|
@@ -413,14 +413,12 @@ function getStyleElement(styleOverrideElementId = "autoconsent-css-rules") {
|
|
|
413
413
|
return css;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
-
function hideElements(styleEl,
|
|
416
|
+
function hideElements(styleEl, selector, method = "display") {
|
|
417
417
|
const hidingSnippet = method === "opacity" ? `opacity: 0` : `display: none`;
|
|
418
|
-
const rule = `${
|
|
419
|
-
","
|
|
420
|
-
)} { ${hidingSnippet} !important; z-index: -1 !important; pointer-events: none !important; } `;
|
|
418
|
+
const rule = `${selector} { ${hidingSnippet} !important; z-index: -1 !important; pointer-events: none !important; } `;
|
|
421
419
|
if (styleEl instanceof HTMLStyleElement) {
|
|
422
420
|
styleEl.innerText += rule;
|
|
423
|
-
return
|
|
421
|
+
return selector.length > 0;
|
|
424
422
|
}
|
|
425
423
|
return false;
|
|
426
424
|
}
|
|
@@ -512,14 +510,14 @@ function wait(ms) {
|
|
|
512
510
|
}, ms);
|
|
513
511
|
});
|
|
514
512
|
}
|
|
515
|
-
function hide(
|
|
513
|
+
function hide(selector, method) {
|
|
516
514
|
const styleEl = getStyleElement();
|
|
517
|
-
return hideElements(styleEl,
|
|
515
|
+
return hideElements(styleEl, selector, method);
|
|
518
516
|
}
|
|
519
|
-
function prehide(
|
|
517
|
+
function prehide(selector) {
|
|
520
518
|
const styleEl = getStyleElement("autoconsent-prehide");
|
|
521
519
|
enableLogs && console.log("[prehide]", styleEl, location.href);
|
|
522
|
-
return hideElements(styleEl,
|
|
520
|
+
return hideElements(styleEl, selector, "opacity");
|
|
523
521
|
}
|
|
524
522
|
function undoPrehide() {
|
|
525
523
|
const existingElement = getStyleElement("autoconsent-prehide");
|
|
@@ -679,6 +677,7 @@ var snippets = {
|
|
|
679
677
|
EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
|
|
680
678
|
EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
|
|
681
679
|
EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
|
|
680
|
+
EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
|
|
682
681
|
EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
|
|
683
682
|
if (x.checked)
|
|
684
683
|
x.click();
|
|
@@ -1072,7 +1071,7 @@ var TrustArcTop = class extends AutoConsentCMPBase {
|
|
|
1072
1071
|
}
|
|
1073
1072
|
hideElements(
|
|
1074
1073
|
getStyleElement(),
|
|
1075
|
-
|
|
1074
|
+
`.truste_popframe, .truste_overlay, .truste_box_overlay, ${bannerContainer}`
|
|
1076
1075
|
);
|
|
1077
1076
|
click(cookieSettingsButton);
|
|
1078
1077
|
setTimeout(() => {
|
|
@@ -1197,9 +1196,7 @@ var Cookiebot = class extends AutoConsentCMPBase {
|
|
|
1197
1196
|
return await this.mainWorldEval("EVAL_COOKIEBOT_1");
|
|
1198
1197
|
}
|
|
1199
1198
|
async detectPopup() {
|
|
1200
|
-
return
|
|
1201
|
-
return this.mainWorldEval("EVAL_COOKIEBOT_2");
|
|
1202
|
-
}, 10, 500);
|
|
1199
|
+
return this.mainWorldEval("EVAL_COOKIEBOT_2");
|
|
1203
1200
|
}
|
|
1204
1201
|
async optOut() {
|
|
1205
1202
|
await wait(500);
|
|
@@ -1423,7 +1420,7 @@ var Evidon = class extends AutoConsentCMPBase {
|
|
|
1423
1420
|
if (click("#_evidon-decline-button")) {
|
|
1424
1421
|
return true;
|
|
1425
1422
|
}
|
|
1426
|
-
hideElements(getStyleElement(),
|
|
1423
|
+
hideElements(getStyleElement(), "#evidon-prefdiag-overlay,#evidon-prefdiag-background");
|
|
1427
1424
|
click("#_evidon-option-button");
|
|
1428
1425
|
await waitForElement("#evidon-prefdiag-overlay", 5e3);
|
|
1429
1426
|
click("#evidon-prefdiag-decline");
|
|
@@ -2096,7 +2093,7 @@ var AutoConsent = class {
|
|
|
2096
2093
|
this.undoPrehide();
|
|
2097
2094
|
}
|
|
2098
2095
|
}, this.config.prehideTimeout || 2e3);
|
|
2099
|
-
return prehide(selectors);
|
|
2096
|
+
return prehide(selectors.join(","));
|
|
2100
2097
|
}
|
|
2101
2098
|
undoPrehide() {
|
|
2102
2099
|
this.updateState({ prehideOn: false });
|