Remove Ketch consent banners
This commit is contained in:
@@ -36,6 +36,10 @@ const COMMON_ANNOYANCE_SELECTORS = [
|
||||
".iubenda-cs-container",
|
||||
"#cmpwrapper",
|
||||
"[id^=\"cmpbox\"]",
|
||||
"#ketch-banner",
|
||||
"#ketch-consent-banner",
|
||||
"#lanyard_root:has(#ketch-banner)",
|
||||
"[class*=\"ketch-\"][role=\"dialog\"][aria-label*=\"privacy\" i]",
|
||||
".fc-consent-root",
|
||||
".fc-dialog-container",
|
||||
"[aria-modal=\"true\"][id*=\"consent\" i]",
|
||||
@@ -79,8 +83,11 @@ const COMMON_ANNOYANCE_TEXT_PATTERNS = [
|
||||
"allowlist",
|
||||
"continue using your ad blocker",
|
||||
"disable your ad blocker",
|
||||
"non-essential cookies",
|
||||
"reject non-essential cookies",
|
||||
"support us by disabling",
|
||||
"support the verge by allowing ads",
|
||||
"tracking technologies",
|
||||
"turn off your ad blocker",
|
||||
"you are using an ad blocker"
|
||||
];
|
||||
|
||||
@@ -100,6 +100,34 @@ test("renderPage removes common cookie consent overlays before snapshot", async
|
||||
assert.doesNotMatch(rendered, /<body[^>]*class="[^"]*didomi-popup-open/i);
|
||||
});
|
||||
|
||||
test("renderPage removes Ketch consent banners before snapshot", async () => {
|
||||
const html = `<!doctype html>
|
||||
<html>
|
||||
<body>
|
||||
<main>Article text</main>
|
||||
<div id="lanyard_root">
|
||||
<div id="ketch-banner" style="position: fixed; bottom: 0; left: 0; right: 0; z-index: 2147483647;">
|
||||
<div id="ketch-consent-banner" role="dialog" aria-label="privacy banner">
|
||||
<p>We and our vendors use tracking technologies to recognize visitors.</p>
|
||||
<button id="ketch-banner-button-tertiary" aria-label="Reject Non-Essential Cookies">
|
||||
Reject Non-Essential Cookies
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
const rendered = await renderPage(`data:text/html,${encodeURIComponent(html)}`, {
|
||||
userscriptDelay: 0
|
||||
});
|
||||
|
||||
assert.match(rendered, /Article text/);
|
||||
assert.doesNotMatch(rendered, /id="ketch-/);
|
||||
assert.doesNotMatch(rendered, /Reject Non-Essential Cookies/);
|
||||
assert.doesNotMatch(rendered, /tracking technologies/);
|
||||
});
|
||||
|
||||
test("renderPage removes Admiral adblock walls before snapshot", async () => {
|
||||
const html = `<!doctype html>
|
||||
<html style="overflow: hidden;">
|
||||
|
||||
Reference in New Issue
Block a user