October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
automated screenshots

How to Hide Chat Widgets in Automated Screenshots

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

For Playwright, hide a chat widget only while the screenshot is being captured by using the screenshot option style with a site-verified CSS selector. That keeps the application’s normal page state intact outside the capture. Use mask instead when covering the widget’s pixels is enough. In Cypress, change the widget’s visibility through test setup or its vendor API; Cypress UI Coverage filters affect coverage reports, not screenshot images.

Choose the method that matches what you need to change

“Hide the widget” can mean several different things. A screenshot-time stylesheet changes what is rendered for the capture; a mask covers pixels in the saved image; a vendor API changes the widget’s displayed state; and a coverage filter removes UI from a report. These are not interchangeable. Decide whether the page itself should change, or only the artifact or report.

Method What changes Best fit
Playwright screenshot style CSS is applied while the screenshot is taken. Repeatable screenshots that omit a dynamic widget without changing normal page behavior.
Playwright screenshot mask A colored overlay conceals matched locator boxes in the image. Covering a known area when the underlying widget can remain present.
Vendor API or test setup The widget’s visibility or state changes on the page. Cypress or cases where the vendor provides a stable, supported control.
Cypress UI Coverage elementFilters Elements are excluded from coverage reporting. Reducing third-party UI noise in a coverage report, not hiding pixels in a screenshot.

Prefer a scoped stylesheet or the widget vendor’s documented API over blocking the widget’s network scripts by default. Blocking requests can alter other page behavior and create a state unlike the one visitors see.

Hide a widget in a Playwright screenshot

Playwright’s Page API offers two screenshot options for this task: style and mask. The style option was added in Playwright v1.41; use a compatible version. Playwright documents it for hiding dynamic elements or changing their properties during capture. The injected stylesheet pierces Shadow DOM and applies to inner frames, which can help with embeds that ordinary page CSS cannot reach.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Use screenshot-time CSS when the page should otherwise behave normally

Replace the sample selectors below with selectors verified against the page under test. They are examples, not universal chat-widget selectors.

await page.screenshot({
  path: 'page.png',
  style: `
    #intercom-container,
    iframe[title*="chat" i],
    .support-chat-launcher {
      display: none !important;
    }
  `,
});

Use this in the capture step after navigating to the page. The CSS is supplied to the screenshot operation, rather than being added permanently to the site’s stylesheets. Check the result: a vendor may render its launcher in an iframe, Shadow DOM, or generated markup, and class names can change. A selector that no longer matches may silently leave the widget visible.

Use masking when covering the box is sufficient

Pass a Playwright locator in the screenshot’s mask array to overlay its matched element. Masking does not remove the widget from the page; it covers the corresponding area in the image. Set maskColor if the default-colored overlay is not appropriate for the artifact. Playwright documents that invisible matched elements are masked too unless visibility matching is adjusted, so ensure the locator matches only what you intend to conceal.

await page.screenshot({
  path: 'page.png',
  mask: [page.locator('.support-chat-launcher')],
  maskColor: '#ffffff',
});

Masking is useful when a stable locator is available but you do not need to change page behavior. It may conceal only the matched box, not a larger open conversation panel, so inspect the captured image and widen or change the locator if necessary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Hide chat widgets in Cypress without confusing screenshots and coverage

Cypress supports manual screenshots with cy.screenshot() and can capture screenshots automatically on test failure during cypress run. The screenshotOnRunFailure setting controls whether those failure screenshots are captured; turning it off disables the failure image rather than removing one widget while keeping the rest of the page screenshot.

To retain screenshots but omit a widget in Cypress, arrange for the widget to be hidden during test setup or call the widget vendor’s supported API. The exact setup depends on the application and widget generation. Verify that the widget is actually hidden before taking the screenshot; a filter intended for a report is not a substitute.

What Cypress UI Coverage filters do

Cypress UI Coverage provides elementFilters for excluding third-party UI elements from coverage reports, including a documented Intercom example. This changes the coverage report, not screenshot pixels. For a third-party embed inside an iframe or Shadow DOM, Cypress’s documentation describes pairing a wildcard selector with documentScope. Match the interactive elements themselves and scope the filter to the relevant document.

Use the widget vendor’s API when it is the right product generation

Vendor APIs can be more stable than selectors, but command names and behavior differ between product generations. Confirm which widget is installed and whether the change should apply only to a test or to real visitors.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Zendesk Web Widget (Classic)

Zendesk’s Classic Web Widget Core API uses zE('webWidget', 'hide') to hide all parts of the widget. Call zE('webWidget', 'show') to restore its previous display state. The commands can be invoked before or after page load. This is the Classic API: do not assume the webWidget namespace controls Zendesk’s newer Messaging Web Widget.

Zendesk Messaging Web Widget

For Messaging, the commands use the messenger namespace: zE('messenger', 'hide') and zE('messenger', 'show'). Hiding and closing are different. hide conceals the widget and launcher; close conceals the messaging iframe but leaves the launcher visible. Pair hide with show, and close with open, rather than mixing the command pairs.

If the goal is to remove the widget entirely from a page, Zendesk’s guidance is to remove its source code. If it should remain available but be suppressed on selected pages, use the appropriate page-level hide or suppression approach.

Intercom Messenger

Intercom documents launcher visibility controls in Messenger settings and the hide_default_launcher key in the intercomSettings snippet. This controls launcher visibility; confirm whether an already-open Messenger panel must also be handled. The setting can also affect Messenger on the Help Center, so use a page display condition if the launcher should remain visible there.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Make the result reliable across pages and runs

  • Inspect the rendered widget. Determine whether the launcher and panel are ordinary elements, iframes, or Shadow DOM content. Choose a locator or vendor API based on the actual implementation.
  • Scope the change. Screenshot-time CSS is limited to the capture operation. A vendor setting may affect multiple pages, visitors, or Help Center surfaces; test setup should avoid leaking the hidden state into unrelated tests.
  • Account for load timing. A widget can appear after the main page renders. Ensure your capture waits for the page state your test requires, then confirm the screenshot does not contain the late-loading launcher.
  • Check open and closed states separately. Hiding a launcher is not necessarily the same as hiding an already-open chat panel.
  • Keep selectors maintainable. Generated classes and vendor markup can change. Prefer documented APIs where they fit, and include screenshot checks that catch a selector that stops matching.
  • Do not mistake report cleanup for visual cleanup. Cypress UI Coverage filters do not change pixels, and Playwright masking does not remove the widget from the page.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot a widget that still appears

The CSS selector matches nothing

Inspect the rendered page and identify the launcher or panel actually present. Replace example selectors with a selector stable for that site; do not assume one vendor’s markup or a generic class name applies everywhere.

The widget is inside an iframe or Shadow DOM

For Playwright screenshot-time CSS, the documented style option pierces Shadow DOM and applies to inner frames. Confirm the installed Playwright version is v1.41 or later. If using Cypress, use the vendor API or the relevant document scoping for UI Coverage filters; a coverage filter still will not hide screenshot pixels.

The launcher disappears but the open panel remains

Launcher visibility settings may not close or conceal an already-open panel. Use the correct vendor command for the installed product and distinguish Zendesk Messaging’s hide behavior from close.

A colored box appears in the screenshot

That is the Playwright mask overlay. Set maskColor to a color suitable for the image, or use screenshot-time CSS if the widget should not appear rather than be covered.

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.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

The widget vanishes on the Help Center too

Review Intercom’s page display conditions. Its launcher visibility setting can affect Help Center display; apply a condition that preserves the launcher on that surface if required.

The screenshot is missing entirely

Check whether Cypress failure screenshots were disabled through screenshotOnRunFailure. That setting controls capture on failure; it does not selectively hide an element.

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. For an API capture, make one GET request with the target URL; see the ScreenshotNeo API documentation for options including custom CSS. This example captures a page as WebP:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
  • Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot; each cleanup step can be turned off.
  • Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers identify the page verdict and billing status.
  • An MCP server lets AI agents, including Claude and Cursor, take screenshots through MCP clients.
  • The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo and get 1,000 screenshots a month free, with no card.

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

Questions developers often ask

Can I hide a chat widget in a screenshot without changing the live site?

Yes. Playwright’s screenshot-time style applies CSS during capture. A vendor API or persistent site setting may instead change the widget’s actual visibility, so scope it to the test when that distinction matters.

Will Playwright’s screenshot stylesheet reach widgets in nested frames?

Playwright documents that the screenshot style option applies to inner frames as well as piercing Shadow DOM. The selector still needs to match the widget content you intend to hide.

Does Cypress UI Coverage remove chat from Cypress screenshots?

No. Its elementFilters exclude matching UI from coverage reporting. Use test setup or a vendor control to affect the page shown in an image.

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.