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
World desk4 min

Remove a Virtual Screen in Puppeteer

Use browser.removeScreen(id) to remove a runtime screen in headless Chrome. For a page viewport, use page.setViewport(null)—the two operations are different.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To remove a screen added to headless Chrome at runtime, call await browser.removeScreen(screenId) with the ID returned by browser.addScreen(). If you mean the page’s viewport instead, use await page.setViewport(null); that resets page dimensions, not the browser’s screen configuration.

First identify what “virtual screen” means

Puppeteer has separate controls for Chrome’s screen configuration and for a page viewport. A screen is part of the browser’s display setup; a viewport is the area in which an individual page renders. Removing a screen will not reset a viewport, and resetting a viewport will not remove a screen.

What you want to change Use Scope
Remove a screen added while headless Chrome is running browser.removeScreen(screenId) Browser screen configuration; dynamic removal is headless-only.
Reset a page viewport page.setViewport(null) That page’s viewport.
Resize page content dimensions page.resize({contentWidth, contentHeight}) Browser window content dimensions, using Puppeteer’s window-management API.

Remove a screen added at runtime

Puppeteer’s screen-configuration guide documents Browser.addScreen() and Browser.removeScreen() for adding and removing screens while Chrome is running. Save the returned screen object and pass its id to the removal method.

const added = await browser.addScreen({
  left: 800,
  top: 0,
  width: 800,
  height: 600,
  label: '2nd',
});

await browser.removeScreen(added.id);

If you already have the screen ID, pass it directly:

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
await browser.removeScreen(screenId);

The official guide’s example returns the screen count from two to one after removing the added screen. The example coordinates and dimensions describe that configuration; use the ID for the screen you actually added rather than deriving an ID from its position or size.

Check the current screens

Use await browser.screens() to inspect the browser’s screen list. The guide documents this inspection method in both headless and headful modes, even though runtime add and remove are headless-only.

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
const screens = await browser.screens();
console.log(screens);

Mode and launch configuration

The dynamic addScreen() and removeScreen() APIs apply to headless Chrome. If Chrome is headful, the guide describes its screens as physical platform screens; do not expect the headless runtime-removal API to remove one.

The guide also notes that, absent a --screen-info switch, headless Chrome has one default 800×600 screen unless --window-size is specified, in which case the screen is as large as the requested window. That launch-time sizing is distinct from removing a screen added later.

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.

Reset the page viewport instead

If the issue is that responsive layout or page rendering is constrained by a viewport set earlier in the script, reset it with null:

await page.setViewport(null);

Puppeteer’s Page.setViewport() reference says null resets the viewport to its default value. It does not change the browser’s screen list.

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

Some viewport changes can reload the page when settings involving isMobile or hasTouch change. If a reset is followed by a reload, check those emulation options as well as the viewport dimensions.

Resize page content dimensions

If your goal is to change the browser window’s content width or height rather than screen topology or page viewport emulation, Puppeteer documents Page.resize(). Its window-management guide clears the default viewport first and waits for the resize event because the inner window size updates asynchronously.

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.
await page.setViewport(null);

const resized = new Promise(resolve => {
  page.once('resize', resolve);
});

await page.resize({ contentWidth: 1200, contentHeight: 800 });
await resized;

const dimensions = await page.evaluate(() => ({
  width: window.innerWidth,
  height: window.innerHeight,
}));
console.log(dimensions);

Use the resize event before reading the new inner dimensions; otherwise, code may observe the previous size while the update is still pending.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot the wrong-size or extra-screen problem

  • removeScreen is unavailable or does not apply: Confirm that Chrome is running headless. The dynamic screen methods are documented for headless mode only.
  • The page still renders at the old dimensions: Check whether the changed value is the page viewport, the screen configuration, or the browser content size. Use the corresponding API rather than substituting one for another.
  • You do not know the screen ID: Inspect await browser.screens() and retain the object returned by addScreen() in future code so its ID is available for removal.
  • Dimensions appear unchanged immediately after resizing: Wait for the window resize event before reading window.innerWidth or window.innerHeight.
  • The page reloads after a viewport change: Review changes to isMobile and hasTouch, which Puppeteer identifies as settings that can trigger a reload in some cases.

Or skip the browser setup:

If your actual goal is to capture a website rather than manage Chrome’s screen topology, ScreenshotNeo returns a screenshot or PDF with one GET request. Its clean-shot steps accept cookie and consent banners like a visitor, then remove more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off.

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

See the ScreenshotNeo API documentation for request options. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and whether the request was billed. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and other 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 1,000 free screenshots a month with no card.

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 *

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. 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…
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.