Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the page’s own dismissal or consent control when the dialog changes site state; use Playwright’s targeted CSS, locator handlers, or screenshot masks when you need repeatable automation. A clean capture is not always produced by deleting every element that looks like a banner. Cookie choices, age gates, login requirements, and access checks can affect what content is legally or technically available. Decide whether you need to change the page or only hide pixels, then capture and inspect the result.

Choose the right way to remove an overlay

There are four practical approaches. They differ in whether the page reflows, whether a consent decision is made, and how reliably the method works across URLs.

Method What it changes Best use Main risk
Site control Changes page state through the site’s own close, reject, or accept action One-off captures and legitimate consent flows An “accept” action may store consent or enable tracking
Screenshot-time CSS Hides selected elements while the image is rendered Repeatable visual cleanup Broad selectors can hide useful content or controls
Locator handler Runs a dismissal when a matching overlay appears around an action or assertion Intermittent automation obstructions It does not run merely because an overlay appeared while the script was idle
Mask Covers a locator’s bounding box in the output Redacting or obscuring an area without changing layout Content underneath remains covered; layout does not collapse

Playwright documents all three automation techniques and its fullPage option in the Page API documentation. A mask is not equivalent to removing an element: it paints over the box, so inspect the image for obscured text or controls.

Manual browser workflow for a single screenshot

  1. Open the exact URL and wait for the layout, fonts, and images to settle.
  2. Identify what is blocking the view. Determine whether it is a cookie or privacy choice, an age or access gate, a newsletter promotion, a chat widget, or an advertisement.
  3. For consent, use the site’s appropriate choice (for example, reject or accept according to your purpose). For a promotional prompt, use its visible close or dismissal control when available.
  4. Capture the viewport or full page.
  5. Inspect the image at the top, bottom, and page edges. Look for sticky bars, blank spaces left by removed elements, lazy images that did not load, and content hidden along with the overlay.

Do not treat every dialog as disposable decoration. Google Search Central’s guidance on interstitials and dialogs distinguishes obstructive interstitials from necessary gates such as age checks. Removing an access requirement may produce a misleading or unauthorized capture.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Playwright: hide known selectors with CSS

When you control the target pages and have inspected their markup, add narrowly scoped CSS immediately before the screenshot. The selectors below are examples only; replace them with selectors from the actual site.

#1 Best Overall
Magicmoon 2-Pack 24 Inch Computer Privacy Screen Filter for 16:9 Monitor
  • Compatible Model(s): Magicmoon brand filter only for 24 inch -diagonally measured - widescreen monitor - aspect ratio 16:9 - filter size: width: 20 15/16", Height: 11 13/16" (531mm x 298mm)
  • Superior Privacy: The computer privacy filter makes the screen appear dark when looking at it from an angle (the angle is about 30 to 60 degree), but bright when looking directly at it. To change the privacy level - simply adjust your monitor’s brightness accordingly
  • Eye and Screen Protection: Privacy Filter does not only protect your private life but also protects your eyes by blocking 30% of blue light , blocking the harmful blue light between 380 to 495 nm, it filters out the blue light and relieves eye strain
  • Perfect For Open Workspaces: Great for maintaining screen privacy in open work spaces
  • Includes Two Options: Option 1 uses clear adhesive strips that securely attach to any computer screen. Option 2 (for computer screens with a raised bezel only) uses slide mount tabs that easily stick to the display frame, allowing you to slide the privacy screen filter on and off as needed
import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto('https://example.com', { waitUntil: 'networkidle' });

await page.addStyleTag({
  content: `
    .site-specific-popup,
    .site-specific-ad-slot,
    .site-specific-chat-widget {
      display: none !important;
    }
  `
});

await page.screenshot({ path: 'page.png', fullPage: true });
await browser.close();

Playwright’s screenshot API also accepts a capture-time style string. Use it when the cleanup should apply only to that screenshot rather than persist as page styling. Keep selectors specific. A rule such as [class*="ad"] can match navigation, article content, or a legitimate “add” control.

When hiding causes an unwanted gap

display: none removes the element from layout, which can collapse space and move content. If preserving the original geometry matters, prefer a mask or a style that keeps the box dimensions while making it visually unobtrusive. Always compare the output with the unmodified page.

Playwright: dismiss predictable and intermittent overlays

Predictable overlay

For a dialog that appears on every run, wait for it and perform the intended action as part of the normal flow. The locator should describe the actual button, not a generic word such as “close.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const consent = page.getByRole('button', { name: /reject optional|close/i });
if (await consent.isVisible().catch(() => false)) {
  await consent.click();
}
await page.screenshot({ path: 'clean.png', fullPage: true });

Clicking “accept” can record a consent choice; it is a state-changing operation, unlike screenshot-only CSS or masking. If your policy requires a particular choice, encode that choice explicitly and document it.

Rank #2
SightPro 24 Inch 16:9 Computer Privacy Screen Filter for Monitor - Privacy Shield and Anti-Glare Protector
  • 【Privacy Filter Dimensions】- Width: 20 15/16" (532 mm), Height: 11 13/16" (299 mm), Diagonal: 24" (609.6 mm) - SightPro Blackout Privacy Screen Filter is engineered to be compatible with HP, Dell, Samsung, Lenovo, LG, Acer, ASUS, ViewSonic, and other monitor brands. Please verify your computer screen's width and height measurements before ordering. It's not recommended to make your selection based solely on your computer screen's diagonal size.
  • 【Two Attachment Options】- Installs in minutes. Option 1 uses clear adhesive strips that securely attach to any computer screen. Option 2 (for computer screens with a raised bezel only) uses slide mount tabs that easily stick to the display frame, allowing you to slide the privacy screen filter on and off as needed.
  • 【Superior Privacy and Anti Glare】- Our advanced multi-layered film filter blacks out your computer screen when viewing from the side, while maintaining a crystal clear screen straight-on. It also protects your eyes from harmful glare, UV, and blue light. [Note: It does not block visibility directly behind you, regardless of the distance.]
  • 【Perfect for Travel and Open Workspaces】- Our computer screen privacy filter is the ideal solution for healthcare providers, mobile workers, commuters, students, and business travelers. Now you can stay compliant and safeguard sensitive corporate information while working in airplanes, subways, airports and public areas.
  • 【Package Contents】- Each package includes one privacy screen shield filter, two sets of clear adhesive strips, two sets of slide mount tabs, and a microfiber cleaning cloth. Buy with confidence – located in the US, Sight Pro specializes in providing best-in-class privacy solutions to individuals, small businesses, corporations, government, and educational institutions. Our privacy screens are Section 889 and TAA compliant.

Unexpected overlay during actions

page.addLocatorHandler() is intended for an overlay that appears unpredictably and blocks an action or assertion. The handler is checked around those operations, not continuously in the background. Handler execution counts toward the operation timeout, and Playwright normally waits for the triggering overlay to become hidden before continuing.

const blocker = page.locator('.site-specific-popup');
await page.addLocatorHandler(blocker, async () => {
  const close = page.getByRole('button', { name: /close|dismiss/i });
  if (await close.isVisible().catch(() => false)) await close.click();
});

await page.getByRole('link', { name: 'Pricing' }).click();
await page.screenshot({ path: 'pricing.png', fullPage: true });

Use a handler only after verifying that closing the overlay is safe for the workflow. For a visual-only requirement, a screenshot mask may be less invasive.

Mask an element instead of removing it

Masking covers the selected locator’s bounding box in the screenshot. It preserves the page’s layout and is useful when you must avoid exposing a chat widget, ad creative, or sensitive area without changing document flow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const chat = page.locator('.site-specific-chat-widget');
await page.screenshot({
  path: 'masked.png',
  fullPage: true,
  mask: [chat]
});

Check the image at the mask boundaries. A fixed widget can overlap article text, and the mask will cover that text too. If the element is outside the initial viewport, ensure your full-page capture and page state make it present before masking.

Rank #3
Computer Privacy Screen Filter for 24 Inch 16:9 Aspect Ratio Monitor
  • Privacy Screen Filter Size: If the visible area of your display has the following dimension: Width x Height (Exclude Frame/Arrow 1 to 3 mm errors): 20 15/16" x 11 13/16" (532 mm x 299 mm), then this filter is good for you. Very Important to double check your screen's Width and Height excluding frame before ordering. It's not recommended to make your selection based solely on your screen's diagonal size
  • Left and Right Privacy: Not block visibility directly behind you, regardless of distance. The privacy filter makes the screen appear dark when looking at it from an angle (left and right 30 to 180 degree), but clear when looking directly at it. To change the privacy levels, simply adjust your monitor's brightness level accordingly
  • Matte and Glossy Sides: It's a reversible privacy screen filter, giving you the flexibility to choose glossy or matte finish. The matte side will have less glare, however the glossy side will have stronger privacy
  • Perfect for Open Workspaces: Ensure your working space is bright and well lit. Privacy screens do not work in dimly lit areas
  • Two Installation Option: Option 1 uses clear double side adhesive strips that securely attach to any computer screen. Option 2 (for computer screens with a raised bezel only) uses slide mount tabs that easily stick to the display frame, allowing you to take out the privacy screen filter easily as needed

Chrome DevTools for focus-dependent controls

Some menus, date pickers, and dropdowns disappear when the page loses focus. In Chrome DevTools, open the Rendering tab and enable Emulate a focused page to inspect those controls. Chrome notes that this sets document.visibilityState to visible and prevents the visibilitychange event from firing. Treat it as a debugging aid, not proof that ordinary browsing will produce the same state.

Hosted consent handling

Browserless documents a blockConsentModals=true option for screenshot and PDF endpoints and recommends custom selectors for cases its built-in blocker does not cover. Its Playwright example checks candidate accept selectors and clicks a visible match before taking a full-page screenshot. Because clicking an accept button can make a consent choice, decide whether that behavior is appropriate before enabling it. See the Browserless cookie-consent example for the vendor’s implementation details.

Full-page capture, lazy content, and layout checks

  • Wait for a meaningful condition such as a main content selector, a short delay for animations, or network idle; no single wait is correct for every site.
  • Scroll or use a full-page capture so lazy-loaded images are requested before the final image is written.
  • Disable or wait for carousels, sticky headers, and animated chat launchers when they can move during capture.
  • Use a fixed viewport and device scale for repeatable output. Record the URL, viewport, and cleanup selectors alongside the image.
  • Open the final PNG, JPEG, or WebP and inspect areas that automation cannot understand: consent text, blank ad slots, clipped fixed elements, and content accidentally hidden by a broad rule.

Troubleshooting common failures

The popup is still visible

The selector may target a wrapper while the visible dialog is inside an iframe or shadow DOM. Inspect the frame and actual visible element, then target its close control or the correct frame locator. Also check whether the popup appears only after a delay or scroll.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The script times out while clicking

The overlay may be present but covered by another layer, outside the viewport, or not actionable. Wait for visibility, use the site’s documented control, and avoid force-clicking unless you have verified the result. For intermittent cases, ensure the locator handler is registered before the blocked action.

Rank #4
Peslv 2-Pack 24 Inch 16:9 Computer Monitor Privacy Screen, WxH:532 * 299mm
  • 【PRIVACY FILTER DIMENSIONS】- Width: 20 15/16" (532 mm), Height: 11 13/16" (299 mm), Diagonal: 24" (609.6 mm) - Peslv Dark 24 inch Privacy Screen Filter is engineered to be compatible with 24in Dell, HP, Samsung, Lenovo, LG, Acer, ASUS, Toshiba, ViewSonic, Aoc, Sceptre, PHILIPS, ViewSonic and other brands monitors with 16:9 aspect ratio. Please verify your computer screen's width and height measurements before ordering. It is not recommended to select a size based solely on the diagonal.
  • 【HIGH-CLASS PRIVACY ABLE】Peslv collected suggestions from more than 2000 computer users and performed 22188 anti-peep angle corrections on the micro-blind optical technology to ensure that any line of sight beyond +-30° facing the screen will be shielded. With a Peslv computer privacy screen 24 inch, Protect the privacy of your computer monitor screen and no longer leak any confidential data.
  • 【2 MOUNTING OPTIONS FOR EASY INSTALLATION】The Peslv 24 inch privacy screen for monitor supply 2 installation options, Various installation options, are Compatible with both 24" computer monitors with raised bezels and full-screen 24" computer monitors without raised bezels, and convenient installation allows you to complete the installation in 9 seconds. NOTE: Monitors without raised bezels are only available with mounting option 2.
  • 【EXCLUSIVE DOUBLE-SIDED TECHNOLOGY】24-inch monitor privacy filter has a double-sided surface technology developed by Peslv. Matte or Glossy. With the matte surface facing outward, you can experience the advanced AG anti-glare technology from Germany while maintaining a 30-degree privacy angle, softening the strong light outdoors, and making the screen content clearly visible. With the glossy side facing outward, you can get a super anti-peeping effect with a privacy angle of 26 degrees.
  • 【PROTECT SCREEN ALSO EYES】Filtering optical materials imported from Japan can reduce 92% of blue light and 98% of UV light, and filter all harmful light emitted from the screen to protect your eyes. The high-transparent and reinforced built-in protective layer not only presents high-definition picture quality but also protects your screen from scratches. Hurry up and place an order, own a privacy screen for a computer monitor 24 inch, and protect your monitor screen and your eyes.

Removing the banner leaves a large blank area

The page may reserve space on a parent container. Hide or resize the parent only after confirming it is dedicated to the overlay; otherwise use a mask to retain geometry.

Useful content disappeared

Your selector is too broad. Replace class-name fragments with a component-specific selector, role, or stable data attribute. Compare a capture with cleanup disabled before changing more rules.

Images are blank in full-page output

Lazy loading may require scrolling or waiting for a selector. Capture after the image’s network request completes, and verify that the page is not still transitioning between responsive layouts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A consent choice changes later pages

That is expected when the control writes a cookie or local-storage value. Use an isolated browser context for each run, make the intended choice explicit, and do not describe a consent-clicked capture as an untouched page state.

Best Value
[2 Pack] 24 Inch Computer Privacy Screen Filter for 16:9 Widescreen Monitor
  • 【24 PRIVACY FILTER DIMENSIONS】 Width: 20 15/16" (20.9 inches/532 mm), Height: 11 13/16" (11.8 inches/299 mm) - 16:9 Aspect Ratio. Mamol computer privacy filters are designed to be perfectly compatible with HP, Samsung, Dell, Lenovo, Acer, Asus, LG, ViewSonic and other brands of monitors. Please check the width and height dimensions of your computer screen before ordering. If you have any questions about the dimensions, please contact us.
  • 【ENHANCED PRIVACY PROTECTION】Mamol 24 inch computer privacy filter keeps your electronic information confidential, making it excellent for use in high traffic areas. the computer privacy screen 24 inch is designed with advanced microlouver technology to block visibility at around 30 degrees and black out screens completely near 60 degrees.
  • 【EYES PROTECTION】 This blackout privacy screen greatly reduces eye strain and minimizes potential hazards to vision. It filters 99.9% of UV rays and suppresses 98% of blue light. As a reversible 24-inch privacy screen filter: The glossy side of the protector provides extra clarity and greater privacy, and the matte side minimizes glare and distracting reflections. Satisfy your different daily uses as needed.
  • 【BETTER HD CLARTIY】Mamol 24 inch computer privacy screen Shield adds an extra layer of AR Ultra HD light transmission compared to others. It maintains the high definition of the screen without sacrificing too much screen brightness. It won't reduce the brightness and cause eye fatigue because of the privacy screen installed on the screen.
  • 【ANTI SCRATCH & WASHABLE 】Our privacy anti-glare Monitor film has a surface enhancement layer to protect the privacy filter from scratches and fingerprints. It is washable and reusable. Even after prolonged use, you will get a brand new privacy screen for your desktop computer monitor after cleaning. Very Durable!
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF, and its cleanup steps can accept the cookie or consent banner and remove more than 60 known consent platforms, newsletter popups, and chat widgets. Each step can be turned off. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status.

Use the ScreenshotNeo documentation for all options, including full-page capture, CSS-selector element capture, device presets, custom CSS and JavaScript, click-before-capture, waits, request blocking, headers and cookies, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous webhooks, bulk capture, usage data, and PDF settings.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
const data = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', data));

The MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients, so an AI agent can perform captures without your own browser orchestration. Plans include 1,000 shots per month free with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Decide whether the result is trustworthy

Before publishing or using a cleaned screenshot, record which controls were clicked, which elements were hidden or masked, the viewport, and whether the page was gated. A screenshot that removes a newsletter prompt is different from one that bypasses an age or login requirement. Keep the original capture when provenance matters, and treat the cleaned image as a derived artifact.

Frequently Asked Questions

Should I hide a cookie banner or click it?

Use the site’s appropriate consent control when the choice matters to page state. Use CSS or a mask only when you need a visual artifact and do not want to record a consent decision.

Will a Playwright locator handler remove a popup immediately?

No. It is checked around actions and assertions that the overlay interferes with; it does not run continuously while the script is idle.

What is the difference between masking and hiding?

Hiding changes rendered layout by removing an element from view. Masking covers its bounding box in the image, preserving layout but potentially obscuring content underneath.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.