diff --git a/src/archiver.mjs b/src/archiver.mjs index 4586b0a..5975e3e 100644 --- a/src/archiver.mjs +++ b/src/archiver.mjs @@ -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" ]; diff --git a/test/archiver.test.mjs b/test/archiver.test.mjs index 1989221..b50148a 100644 --- a/test/archiver.test.mjs +++ b/test/archiver.test.mjs @@ -100,6 +100,34 @@ test("renderPage removes common cookie consent overlays before snapshot", async assert.doesNotMatch(rendered, /]*class="[^"]*didomi-popup-open/i); }); +test("renderPage removes Ketch consent banners before snapshot", async () => { + const html = ` + + +
Article text
+
+
+ +
+
+ + `; + + 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 = `