October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Fix Playwright Screenshots That Include a Web Page’s Scrollbars

Hide scrollbars in Playwright screenshots with capture-time CSS, preserve scrolling, and troubleshoot differences between browser engines and environments.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

To hide scrollbars in a Playwright screenshot without disabling scrolling, pass capture-only CSS in the style option to page.screenshot(). Use both scrollbar-width: none and the non-standard ::-webkit-scrollbar rule, then check the result in the browser engines your project uses.

Hide scrollbars for one screenshot

The style option injects CSS when Playwright takes the screenshot, so you can hide scrollbars without changing your application’s permanent styles. It was added in Playwright v1.41. Playwright documents that the injected stylesheet applies inside Shadow DOM and inner frames. See the Playwright screenshot API.

const screenshotStyle = `
  *, *::before, *::after {
    scrollbar-width: none !important;
  }

  *::-webkit-scrollbar {
    display: none !important;
  }
`;

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

Remove fullPage: true if you want only the current viewport. The CSS is the part that hides scrollbars; fullPage controls how much of the page Playwright captures.

Why use both CSS rules?

scrollbar-width: none is the standardized rule for hiding a scrollbar while leaving its element scrollable. It is not inherited, so applying it only to a parent does not ensure that scrollbars on descendant elements are hidden. The universal selector in the example targets elements throughout the page.

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.
#1 Best Overall
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

::-webkit-scrollbar is non-standard. It is included as a practical companion rule, not as a guarantee that every browser engine will render scrollbars the same way. Validate the screenshot in your actual Chromium, Firefox, or WebKit setup. See MDN’s scrollbar-width reference and MDN’s ::-webkit-scrollbar reference.

Keep the page scrollable and the live interface accessible

Hiding a scrollbar is different from disabling scrolling. Avoid using overflow: hidden just to remove the visual scrollbar: it changes overflow behavior and can prevent users from scrolling the affected content. The CSS above hides the scrollbar while preserving scrolling.

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

MDN cautions that hiding scrollbars can make content harder to access for people who rely on visible scrolling controls and may not have another way to scroll. Keep this styling scoped to the screenshot call when the live interface should retain its scrollbars. Do not permanently hide controls in product-facing UI without considering how users will discover and operate scrollable content.

What full-page capture does—and does not—mean

Playwright defines fullPage: true as capturing the full scrollable page instead of only the visible viewport. That setting specifies the capture extent; the API does not promise that it will hide scrollbars or force them to appear. See the screenshot API and the Playwright screenshots guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
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.

A full-page screenshot can therefore still need the capture-time CSS above if your goal is to remove visible scrollbars. Conversely, if a scrollbar is missing, fullPage is not by itself evidence of a bug: the observed result can depend on the browser and environment.

Troubleshoot inconsistent scrollbar screenshots

If screenshots differ across machines or a scrollbar appears or disappears unexpectedly, compare the same conditions rather than assuming one universal browser behavior:

Rank #4
Sale
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
  • Browser engine: test the project’s configured Chromium, Firefox, and WebKit runs individually.
  • Operating system: record the OS used for each capture, since the observed scrollbar presentation may vary by environment.
  • Scrollable area: check whether the document or a nested element is scrolling. The CSS targets elements generally, but confirm which element actually owns the scrolling.
  • Capture extent: distinguish a viewport capture from one using fullPage: true.
  • Playwright version: confirm the installed version is at least v1.41 if you rely on the screenshot style option.

A GitHub issue opened on April 3, 2024 reports that a Playwright 1.42.0 full-page screenshot on Windows with Chrome omitted the scrollbar; the reporter also tried ignoring --hide-scrollbars. That is a report about one configuration, not proof of a current universal bug or fix. Reproduce the behavior in your own CI and browser configuration before changing launch flags or treating it as a regression: Playwright issue #30336.

Common problems and fixes

  • The style option is rejected: check the Playwright version; this option was added in v1.41.
  • A nested scroller still shows a scrollbar: make sure the rule targets the element that scrolls. scrollbar-width is not inherited, so a rule only on an ancestor is insufficient.
  • The scrollbar is hidden but content cannot be scrolled: remove any overflow: hidden rule used as a hiding workaround. Use scrollbar styling instead.
  • Results differ between engines: remember that the WebKit pseudo-element is non-standard; compare each target engine and adjust only after reproducing the difference.
  • A full-page capture has no scrollbar even without injected CSS: fullPage sets capture extent, not scrollbar visibility. Check your browser, OS, and scroll container, and verify whether the difference reproduces in the target setup.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a screenshot rather than a Playwright-specific capture, ScreenshotNeo is a website screenshot API and MCP server. A single GET request can return an image or PDF, and its capture process removes cookie banners, newsletter popups, and chat widgets before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed; response headers identify the page verdict and billing status. AI agents can use its MCP server tools to take screenshots, get page information, and capture PDFs.

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

For the ScreenshotNeo API documentation, here is the cURL call using the documented endpoint and parameter format:

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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo includes 1,000 screenshots a month on its free plan with no card required; paid plans start at $5 for 3,000 screenshots. Sign up for free and get 1,000 screenshots a month with no card.

Frequently Asked Questions

Can I hide scrollbars only in a Playwright screenshot?

Yes. Use the screenshot `style` option with scrollbar CSS so the change is applied for capture rather than added to the application stylesheet.

Does `fullPage: true` hide scrollbars?

No. It selects the full scrollable page as the capture area; scrollbar visibility is a separate concern.

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.

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.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.