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

Use BrowserCat to provide a cloud Chromium session and Playwright to request dark-mode rendering before the page loads. Then verify the page received the preference and capture its rendered result. This asks the site to use its dark styles; it does not turn a site dark if the site has no dark styling or relies on a separate theme control.

What you need

  • Node.js and the playwright-core package.
  • A BrowserCat API key, supplied to the script as the BROWSERCAT_API_KEY environment variable.
  • A target URL that you are authorized to access and capture.

BrowserCat’s quick start documents connecting Playwright to its cloud endpoint, wss://api.browsercat.com/connect, using the API key in an Api-Key header. It describes the session as Chromium in “new” headless mode. See the BrowserCat quick start.

Capture a dark-mode screenshot with BrowserCat and Playwright

Install the Playwright client package in your project:

npm install playwright-core

Save the following as capture-dark.mjs. The script connects to BrowserCat, creates a browser context and page, sets the dark color scheme before navigation, checks the preference visible to the page, and saves a full-page PNG.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
import * as pw from 'playwright-core';

async function captureDark(url) {
  const apiKey = process.env.BROWSERCAT_API_KEY;
  if (!apiKey) {
    throw new Error('Set the BROWSERCAT_API_KEY environment variable first.');
  }

  const browser = await pw.chromium.connect(
    'wss://api.browsercat.com/connect',
    { headers: { 'Api-Key': apiKey } }
  );

  try {
    const context = await browser.newContext();
    const page = await context.newPage();

    // Set the preference before navigation so initial page styles can use it.
    await page.emulateMedia({ colorScheme: 'dark' });
    await page.goto(url, { waitUntil: 'networkidle' });

    const darkPreference = await page.evaluate(
      () => matchMedia('(prefers-color-scheme: dark)').matches
    );
    console.log({ darkPreference });

    await page.screenshot({ path: 'website-dark.png', fullPage: true });
  } finally {
    await browser.close();
  }
}

captureDark('https://example.com').catch(console.error);

Run it with the key set in your shell. On macOS or Linux:

BROWSERCAT_API_KEY='YOUR_API_KEY' node capture-dark.mjs

On PowerShell, set the environment variable for the current session before running the script:

$env:BROWSERCAT_API_KEY = 'YOUR_API_KEY'
node .capture-dark.mjs

Replace https://example.com with the page you want. The output file, website-dark.png, is written to the current working directory. The code follows BrowserCat’s documented connection pattern and Playwright’s documented emulation and screenshot APIs; it is an implementation pattern, not a claim of testing against a particular site. Relevant references: BrowserCat quick start and Playwright Page API.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

What the preference check proves

matchMedia('(prefers-color-scheme: dark)').matches checks whether the page sees a dark color-scheme preference. A value of true confirms the emulated preference reached the page; it does not confirm every component adopted dark styles. Inspect the screenshot itself when the rendered appearance matters.

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

Viewport, full-page, and element captures

The example uses fullPage: true to capture the full scrollable page. Omit that option to capture the current viewport instead. Playwright also supports locator screenshots when you need a specific element rather than the entire page. The Page API documentation describes screenshot options.

Why a page may remain light

page.emulateMedia({ colorScheme: 'dark' }) asks the browser to report a dark preference to the page. Sites that use the CSS prefers-color-scheme media feature can respond to it, but the browser does not recolor arbitrary pages automatically. A site may have no dark theme, use an in-page appearance switch, or store theme selection in account or application state. Playwright documents color-scheme emulation in its emulation guide.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Troubleshooting

The script says the API key is missing

Set BROWSERCAT_API_KEY in the environment used to launch Node. Check that you set it in the same shell or terminal session and that the variable name matches exactly. Avoid putting a live key in source code or committing it to a repository.

The connection fails

Confirm the API key is valid and that the script uses the documented BrowserCat WebSocket endpoint and header: wss://api.browsercat.com/connect and Api-Key. BrowserCat’s connection instructions are in its quick start.

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

The preference check is false

Make sure page.emulateMedia({ colorScheme: 'dark' }) runs before navigating and that the check runs in the same page. Playwright’s Page API documents emulateMedia and page evaluation.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

The preference is true but the screenshot is light

The check only reports the preference. Look for the website’s own theme switcher or appearance setting; the site may require an application-specific choice or account state. If changing the site’s setting after navigation, check the result again and reload if its styles or state do not update.

Navigation does not finish or the capture misses content

The example waits for networkidle before capturing. Pages with long-lived network activity or delayed content can make that wait unsuitable. Choose a readiness condition appropriate to the page—for example, wait for a known selector when the content you need is available—rather than assuming the network becoming idle proves the page is visually complete. BrowserCat’s browser configuration documentation lists its BrowserCat-Opts header and query-parameter configuration; where both are set, headers take precedence. The dark preference in this example is set through Playwright, not a BrowserCat-specific option established by that documentation: BrowserCat browser configuration.

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

BrowserCat, local capture, or an API call?

For a one-off capture, a local browser can avoid cloud-browser credentials and automation setup. BrowserCat with Playwright is useful when you want a repeatable script and a cloud-hosted Chromium session. In either case, dark rendering depends on the target site’s behavior: setting the preference does not guarantee a dark result. BrowserCat documents Chromium and Chrome as supported; its browser configuration page says Firefox and WebKit are on the roadmap, so do not assume those backends are available now. See BrowserCat’s browser configuration overview.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its one-call API can return an image, but this endpoint does not establish the BrowserCat-and-Playwright dark color-scheme emulation workflow above; use the browser method when you specifically need to request prefers-color-scheme: dark through Playwright.

For a regular screenshot, cURL:

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

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; those cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers identifying the page verdict and billing status. Its MCP server provides screenshot tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$24.99
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
SaleBestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$54.99

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.

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.