For a one-off screenshot, dismiss a popup with the website’s own control when appropriate. For repeatable captures, use a narrowly targeted Playwright locator or screenshot-time CSS; use a mask when you want to cover an area without removing it from layout. Then inspect the finished image: hiding an overlay can leave a blank space, conceal useful content, or remove a consent or access control that should not be bypassed.
Choose a method that matches the overlay
“Hide” can mean three different things: make the website dismiss its own dialog, remove an element from the rendered page, or cover the element in the screenshot image. Those choices have different effects on page state and layout.
| Method | What it does | Best fit | Main caution |
|---|---|---|---|
| Site-provided close or consent control | Dismisses the dialog using the page’s normal interface. | One-off captures and predictable test flows. | Accepting or rejecting consent is a real choice, not merely a visual change. |
| Playwright locator handler | Runs code to handle a visible matching overlay around a browser action or assertion. | Unexpected, intermittent obstructions during automation. | It does not run continuously while the script is idle. |
| Screenshot-time CSS or injected CSS | Hides matching elements from the rendered page; `display: none` allows layout to reflow. | Repeatable visual cleanup when you know the page-specific selectors. | Bad selectors can remove useful content or controls. |
| Screenshot mask | Covers a locator’s bounding box in the output image. | Concealing an area without removing the element from page layout. | It can obscure content underneath and does not make the page itself dismiss the overlay. |
Do not treat every dialog as clutter. Cookie choices, login or paywall gates, and age checks can represent consent or access requirements. Google Search Central recognizes that some gates, including age gates, may be mandatory; it recommends small banners rather than full-page interstitials when practical. Google’s guidance on interstitials and dialogs is useful context for site owners as well as people capturing pages.
Dismiss a popup manually
- Open the page and let its layout settle. If the page is still loading, a later popup or sticky element may not yet be visible.
- Identify the overlay and its purpose. Distinguish a promotional prompt from a consent choice, sign-in requirement, age gate, or other access condition.
- For a consent dialog, use the site’s own appropriate choice. For a promotional prompt, use its close or dismiss control if available. Do not assume that clicking “accept” merely removes pixels.
- Capture the desired viewport or full page, then inspect the output for leftover blank space, content shifted by layout changes, or sticky elements that still cover the page.
Using the page’s normal controls preserves its ordinary behavior better than deleting arbitrary elements. This is a practical distinction: a close button may trigger site logic, while hiding a node with CSS only changes what is rendered.
Recommended Free Tools
Hide known overlays with Playwright
For a recurring capture, screenshot-time styling is often the most direct option when the overlay’s selectors are stable and you have verified what they target. Playwright’s screenshot API supports a `style` string applied during capture, as well as `fullPage` for the entire scrollable page. The API also supports `mask` for covering locator bounding boxes in the output. See the Playwright Page API documentation for current details and options.
#1 Best Overall
- 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
Screenshot-time CSS
Replace the illustrative selectors below with selectors inspected on the actual site. The example uses screenshot-time styling so the rule is applied to the capture rather than acting as a general instruction to alter all page interactions.
await page.screenshot({
path: 'page.png',
fullPage: true,
style: `
.site-specific-popup,
.site-specific-ad-slot {
display: none !important;
}
`
});
`display: none` removes matched elements from layout, which may cause the page content below them to shift. That can be desirable for a clean capture, but check the resulting image: an ad slot may have been reserving space, or a selector may match a useful part of the site.
Insert a stylesheet before capture
Use `page.addStyleTag()` when you want to add a style element to the page before taking the screenshot. This simple example is a complete pattern within an existing Playwright script that has a `page` object:
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #2
- 【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.
await page.addStyleTag({
content: `
.site-specific-popup,
.site-specific-ad-slot { display: none !important; }
`
});
await page.screenshot({ path: 'page.png', fullPage: true });
As with screenshot-time styling, selector accuracy matters. Broad rules based on words such as `ad`, `modal`, or `banner` can hide navigation, useful content, or the controls needed to make a consent choice. `addStyleTag()` inserts a style element or stylesheet link; it does not discover the right selectors for you.
Use a mask when the layout should remain
A mask covers the selected locator’s bounding box in the screenshot rather than removing the element and letting the page reflow. For example:
await page.screenshot({
path: 'page.png',
fullPage: true,
mask: [page.locator('.site-specific-popup')]
});
Confirm the mask’s appearance in the saved image. Covering a dialog can also cover content underneath it, and a mask does not dismiss the dialog or make its contents disappear from the live page.
Handle intermittent overlays in automation
For an overlay that sometimes interrupts a click or assertion, Playwright’s `page.addLocatorHandler()` can run a handler when a locator becomes visible. Playwright recommends explicit dismissal in the normal test flow for predictable overlays; locator handlers are intended for unexpected obstructions.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRank #3
- 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
A handler is checked around actions and assertions, not continuously when the script has no action or assertion underway. Its execution counts toward the triggering operation’s timeout, and Playwright ordinarily waits for the triggering overlay to become hidden before continuing. Write the handler for the real page and the intended interaction—for example, click a verified close control rather than accepting consent by default. Refer to the Playwright API documentation for the method’s current signature and behavior.
For an overlay that reliably appears at a known point in a test, handle it explicitly there instead of relying on a background watcher. That makes the state change visible in the script and easier to diagnose.
Inspect focus-dependent controls in Chrome DevTools
Some menus, dropdowns, or date pickers disappear when a page loses focus. Chrome DevTools offers Rendering > Emulate a focused page to examine controls that depend on focus. It is a debugging aid rather than a guarantee that the page is in its ordinary state: Chrome notes that focus emulation sets `document.visibilityState` to `visible` and prevents the `visibilitychange` event from firing. See Chrome’s Rendering panel documentation.
Rank #4
- 【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.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF. For developers who need a clean capture without building browser automation, its capture process accepts cookie/consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in `X-Page-Verdict` and `X-Billed` headers.
For the complete request options, see the ScreenshotNeo documentation. This runnable cURL request saves a WebP capture of Stripe:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Replace `YOUR_API_KEY` with your key and change the target URL as needed. ScreenshotNeo also has an MCP server with `take_screenshot`, `get_page_info`, and `capture_pdf` tools for Claude, Cursor, and other MCP clients. Plans include 1,000 shots per month free with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card required.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot a screenshot that still looks wrong
- The popup is still visible: Confirm that the selector matches the visible element, not an unused template or hidden copy. If the overlay is intermittent, handle it at a point when it is visible or use a locator handler around an action that it can interrupt.
- Useful content disappeared: Narrow the selector and inspect its matches. Avoid generic selectors such as `banner` or `ad`; they can match site navigation, article content, or consent controls.
- The page has a large blank area: Hiding an element with `display: none` can reflow the layout, but the site may use a separate spacer or reserved ad slot. Inspect the DOM and target only the element responsible for the unwanted space.
- The screenshot covers content you want: A mask covers the selected box, including anything visually underneath. Use a verified dismiss control or a more selective style if the underlying content must remain visible.
- The full-page capture includes an overlay only at the top: Determine whether it is fixed or sticky and whether it remains over content as the page scrolls. Inspect the saved image rather than assuming full-page capture removes viewport-level overlays.
- The popup blocks the next test action: Use a handler for a genuinely unexpected overlay, or explicitly dismiss a predictable one before the action. A handler is not a continuously running monitor.
- A control disappears when capturing: Check whether it depends on page focus. DevTools focus emulation can help inspect it, but remember its altered visibility-state behavior.
Keep captures reliable and costs predictable
Repeatable screenshots depend on stable selectors, a settled page, and a clear rule for which overlays may be dismissed. Wait for the page condition your capture needs rather than assuming a fixed delay always means the layout is ready. Keep selectors specific to the site, and review images after changing them: CSS hiding, consent actions, and masking can each produce a different result.
Best Value
- 【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!
For hosted capture, distinguish a failed page from a successful image before treating an output as usable. ScreenshotNeo’s response headers identify the page verdict and whether the request was billed; its stated billing policy excludes bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits. This makes the outcome and billing status visible in the response rather than requiring you to infer them from an image alone.
Frequently Asked Questions
Does hiding a popup in a screenshot change the website’s consent state?
It depends on the method. CSS and masks affect rendering; using a site’s consent control can record an actual choice.
What is the difference between CSS hiding and a screenshot mask?
CSS such as `display: none` removes the matched element from layout and may reflow the page. A mask covers its bounding box in the output image without removing the element from layout.
Can Chrome DevTools permanently hide an overlay?
The Rendering panel’s focus emulation is for examining focus-dependent controls, not a persistent screenshot-cleanup rule.
Quick Recap
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.

