Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →In Playwright, blur a specific element by adding a selector-based CSS rule to the screenshot: use stylePath with toHaveScreenshot(), or the style option with page.screenshot(). The selector must match the rendered element. For a solid cover rather than a blurred appearance, use Playwright’s locator-based mask option.
Blur an element in a Playwright screenshot assertion
Put the CSS rule in a file, then pass its path to toHaveScreenshot(). This is useful when a visual assertion should blur volatile or sensitive-looking content without changing the application’s regular stylesheet.
As an Amazon Associate I earn from qualifying purchases.
-
Create
screenshot.cssalongside your test, or adjust the path to match your project:Recommended: Update Every Outdated Driver on Your PC in One Scan - Free →Recommended: Fix Windows Errors and Clear Junk Files in Minutes - Free Scan →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy./* screenshot.css */ .account-number { filter: blur(8px) !important; } -
Use the selector stylesheet in the assertion:
await expect(page).toHaveScreenshot({ stylePath: './screenshot.css' }); -
Run the test and inspect the resulting screenshot. Confirm that the selector matches only the intended element and that the blur looks sufficient at the image’s actual size.
#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
Playwright’s visual-comparison documentation describes screenshot stylesheets as a way to filter dynamic content; its example hides iframes with CSS. The stylesheet is applied for the screenshot, not as a change to your application’s source data. Playwright: Visual comparisons
toHaveScreenshot() is part of Playwright’s test assertion API and works with the Playwright test runner. If you are not using that runner, use the Page screenshot API instead. Playwright: PageAssertions
Apply CSS to a direct page screenshot
For a direct page.screenshot() call, pass stylesheet text using the style option rather than stylePath:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
await page.screenshot({
path: 'page.png',
style: '.account-number { filter: blur(8px) !important; }',
});
The style option applies CSS for the capture and, according to the Page API documentation, pierces Shadow DOM and applies to inner frames. The API documents this option as added in Playwright v1.41. Playwright: Page
Rank #2
- 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
Choose blur or a solid mask
| Method | What appears in the screenshot | Use it when |
|---|---|---|
CSS filter: blur(...) |
The selected content remains visible as a softened rendering. | You want the area’s shape and colors to remain, while its details become indistinct. |
Playwright mask |
An overlay covers the matched element’s bounding box. The documented default is pink; a mask color can be chosen. | You want a solid cover instead of a softened view. |
Playwright’s mask is locator-based, while a CSS blur rule targets the element through a CSS selector. The PageAssertions API documents maskColor as added in v1.35. Playwright: PageAssertions
Make the selector reliable
-
Prefer a stable class, ID, or attribute that identifies the intended element and no unrelated content.
-
Check the rendered page, not just the source markup: the element must exist and match when the screenshot is taken.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Use
!importantif the page’s own styles override the screenshot rule; remove it if it is unnecessary.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.
-
Inspect the captured image at full size. CSS blur changes the rendered capture, but it does not remove the underlying page content or alter source data. The cited Playwright documentation does not establish blur as a security guarantee. For sensitive information, verify that the exported image fully obscures it.
Version and troubleshooting notes
Playwright documents stylePath for screenshot assertions and style for Page screenshots as introduced in v1.41. If either option is unavailable, check the version installed in the project and update it as appropriate. The maskColor option is documented as introduced in v1.35. Visual comparisons · Page · PageAssertions
-
The element is unchanged: verify the selector against the rendered page, confirm the stylesheet path is correct, and ensure the screenshot is taken after the element appears.
Crashes, 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 minutePC 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 & 11Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
The blur is too weak or strong: adjust the pixel radius in
blur(8px)and inspect the exported image at full size.Rank #4
SaleSamsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)- 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
-
The page style wins: try
!importanton the screenshot rule, then check that the selector is specific to the intended target. -
stylePathdoes not work with your capture: it belongs totoHaveScreenshot(); forpage.screenshot(), use thestylestring option. -
The screenshot assertion API is unavailable: confirm that the project uses Playwright’s test runner and a version supporting the option.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Or skip the browser setup
ScreenshotNeo is a website screenshot API. A single GET request can return a screenshot or PDF; for this example, request a PNG capture of the target page. See the ScreenshotNeo API documentation for request options.
Best Value
- 【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.png
This API is an alternative when you want a hosted capture rather than configuring Playwright locally. ScreenshotNeo removes supported cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, and cache hits are not billed. Its MCP server provides screenshot and PDF tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Learn about ScreenshotNeo or sign up free for 1,000 screenshots a month, no card required.
Frequently Asked Questions
Does CSS blur remove sensitive content from the page?
No. It changes how the selected content is rendered in the screenshot; it does not remove the underlying page content.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsCan I use stylePath with page.screenshot()?
No. Use stylePath with toHaveScreenshot(); the direct Page screenshot API takes stylesheet text in its style option.
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.




