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.

To capture a tab, window, or monitor in a normal Chrome web app, call navigator.mediaDevices.getDisplayMedia() from a user-initiated event on an HTTPS page. Chrome shows its own source picker; after the user chooses a surface, the promise returns a MediaStream that you can preview, record with MediaRecorder, or send through WebRTC. A page cannot silently choose a source or reuse a permanent grant, so design your UI around an explicit Start sharing action and a reliable Stop control.

What the Screen Capture API does

The Screen Capture API exposes the getDisplayMedia() method on navigator.mediaDevices. Chrome lets the user select a browser tab, application window, or entire screen, then supplies the selected video (and, when available and requested, audio) as a live MediaStream.

This is different from taking a static screenshot. The stream can be previewed, recorded, or published to a peer connection. The browser controls the picker and permission prompt; JavaScript receives only the surface the user selected.

Requirements and permission rules

  • Secure context: serve the page over HTTPS (localhost is treated as secure for development).
  • Transient user activation: call the method directly from a click, pointer, or comparable user gesture. Calling it during page load, a timer, or an unrelated asynchronous task can fail.
  • Fresh prompt: Chrome prompts for every capture request. A site cannot store a silent, reusable screen-sharing permission.
  • User-selected source: constraints express preferences for the picker and resulting track; they cannot preselect a particular tab, window, or monitor.
  • Policy controls: managed Chrome installations can disable website screen capture through enterprise policy. Check with the administrator before treating a blocked request as an application defect.

Minimal working implementation

Place a video element and a button in your page:

<button id="startShare" type="button">Start sharing</button>
<button id="stopShare" type="button" disabled>Stop sharing</button>
<video id="preview" autoplay playsinline muted></video>
<p id="status" role="status">Not sharing</p>

Then request the stream from the button handler:

const startButton = document.querySelector('#startShare');
const stopButton = document.querySelector('#stopShare');
const preview = document.querySelector('#preview');
const status = document.querySelector('#status');

let stream = null;

startButton.addEventListener('click', async () => {
  try {
    stream = await navigator.mediaDevices.getDisplayMedia({
      video: true,
      audio: false
    });

    preview.srcObject = stream;
    await preview.play();
    startButton.disabled = true;
    stopButton.disabled = false;
    status.textContent = 'Sharing is active';

    const [track] = stream.getVideoTracks();
    track.addEventListener('ended', stopSharing, { once: true });
  } catch (error) {
    status.textContent = `${error.name}: ${error.message}`;
    stream = null;
  }
});

stopButton.addEventListener('click', stopSharing);

function stopSharing() {
  if (stream) {
    for (const track of stream.getTracks()) track.stop();
    stream = null;
  }
  preview.srcObject = null;
  startButton.disabled = false;
  stopButton.disabled = true;
  status.textContent = 'Not sharing';
}

The ended listener matters because the user can stop sharing with Chrome’s toolbar control or prompt UI. Without it, your application may still display a “sharing” state after the track has ended.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Requesting audio and applying privacy preferences

Set audio: true only when your use case needs sound. Whether audio is offered depends on the selected surface and Chrome/platform support. For example:

const stream = await navigator.mediaDevices.getDisplayMedia({
  video: { displaySurface: 'window' },
  audio: true,
  monitorTypeSurfaces: 'exclude',
  selfBrowserSurface: 'exclude',
  surfaceSwitching: 'include',
  systemAudio: 'exclude'
});

These options influence what Chrome offers and how the resulting capture behaves; they do not bypass the picker.

displaySurface

"browser", "window", and "monitor" indicate a preferred tab, window, or screen category. Chrome can open the corresponding picker pane, but the user still chooses the actual source.

monitorTypeSurfaces

Use "exclude" to remove entire-monitor choices when showing a whole screen would expose unrelated information. "include" permits them and is currently documented as the default. Do not combine "exclude" with displaySurface: "monitor".

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

selfBrowserSurface

"exclude" hides the current tab from the chooser, useful for meeting or conferencing pages where sharing the meeting tab could create a hall-of-mirrors effect. It conflicts with preferCurrentTab: true.

surfaceSwitching

With "include", Chrome may show a control that lets the user switch the shared tab while capture continues. Use "exclude" when switching would be confusing or unsafe.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

systemAudio

"exclude" avoids offering system audio where possible. This can prevent remote-call audio from being sent back into the same call. Audio availability remains surface- and platform-dependent.

Inspecting the selected surface

After permission, inspect the video track’s settings:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const [videoTrack] = stream.getVideoTracks();
console.log(videoTrack.getSettings().displaySurface);
// Usually: "browser", "window", or "monitor"

Use this value to update instructions—for example, warn that a monitor was selected when your workflow expects a single application window. Treat it as information about the user’s choice, not a replacement for your own authorization model.

Record the stream

MediaRecorder can turn the live stream into a downloadable file. MIME support varies, so choose a type the browser reports:

const chunks = [];
const mimeType = MediaRecorder.isTypeSupported('video/webm;codecs=vp9,opus')
  ? 'video/webm;codecs=vp9,opus'
  : 'video/webm';

const recorder = new MediaRecorder(stream, { mimeType });
recorder.addEventListener('dataavailable', event => {
  if (event.data.size) chunks.push(event.data);
});
recorder.addEventListener('stop', () => {
  const blob = new Blob(chunks, { type: recorder.mimeType });
  const url = URL.createObjectURL(blob);
  const link = document.createElement('a');
  link.href = url;
  link.download = 'screen-recording.webm';
  link.click();
  URL.revokeObjectURL(url);
});
recorder.start();
// Later: recorder.stop();

Stop recording before stopping tracks if you need the final dataavailable event. For long recordings, stream chunks to your server instead of retaining the entire file in memory.

Send the capture with WebRTC

Add the tracks to an RTCPeerConnection and complete your normal signaling exchange:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
const peer = new RTCPeerConnection();
for (const track of stream.getTracks()) {
  peer.addTrack(track, stream);
}

// Create an offer, send it through your signaling channel,
// then apply the remote answer according to your WebRTC protocol.
const offer = await peer.createOffer();
await peer.setLocalDescription(offer);

When the capture track ends, stop or renegotiate the peer connection and update remote participants. Screen capture does not provide signaling, authentication, recording storage, or server-side fan-out.

Stopping safely and handling errors

User cancellation

If the user closes the picker, the promise rejects (commonly with NotAllowedError). Leave the page usable and explain that sharing was canceled; do not repeatedly reopen the picker.

Missing or insecure context

navigator.mediaDevices may be unavailable outside a secure context. Deploy over HTTPS and test on a supported Chrome version.

No transient activation

Move the call into the synchronous path of a user event. Avoid wrapping the initial request in a delayed timer or invoking it after an unrelated permission flow.

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

Constraints rejected

Incompatible combinations can produce TypeError or OverconstrainedError. Start with { video: true }, then add one preference at a time. In particular, check the documented conflicts involving monitorTypeSurfaces, displaySurface, selfBrowserSurface, and preferCurrentTab.

Track ends unexpectedly

The user may press Chrome’s stop button, close the shared window, navigate away, or encounter an administrative restriction. Always listen for ended, stop local tracks, clear srcObject, and reset controls.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Audio is absent

Audio is not guaranteed for every source. Verify that audio: true was requested, inspect stream.getAudioTracks().length, and explain to users which tab, window, or operating-system audio Chrome can offer in their environment.

Enterprise-managed devices

Chrome’s screen-video-capture policy can restrict tab, window, or monitor prompts on ChromeOS and Chrome on Windows, macOS, and Linux. Ask the administrator to verify policy settings before changing application code.

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

Ordinary pages versus Chrome extensions

Use getDisplayMedia() for a regular website. Extension APIs such as chrome.tabCapture and chrome.desktopCapture belong to extension architectures and should not be copied into a normal page.

Extension lifecycle rules differ. Chrome’s extension documentation describes capture started in a content script ending on navigation, and recommends an offscreen document with the DISPLAY_MEDIA reason for background recording across navigation. Starting with Chrome 116, an extension can call tabCapture in a service worker after a user gesture and pass a stream ID to an offscreen document. These details do not change the web-page flow described above.

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

Focus behavior and supported versions

Chrome’s Conditional Focus feature lets a web app influence whether the captured tab or window receives focus when sharing starts; Chrome documentation identifies availability from Chrome 109. Verify the exact behavior in the Chrome versions and operating systems your product supports. Picker options, audio behavior, and managed-policy enforcement can vary by version and platform.

Performance, privacy, and reliability checklist

  • Request only the surface and audio your workflow needs.
  • Exclude monitor sources when an entire screen is unnecessary.
  • Keep a visible Stop sharing control and mirror Chrome’s ended state.
  • Do not assume a fixed resolution, frame rate, audio track, or MIME type; inspect settings and feature-test codecs.
  • Throttle expensive canvas processing and avoid retaining unbounded recording chunks.
  • Explain exactly what participants will see before opening the picker.
  • Test cancellation, navigation, closing the source window, browser stop controls, revoked policy access, and network loss during WebRTC signaling.

Or skip the browser setup

If you need a clean image or PDF of a public URL rather than an interactive user-selected screen, ScreenshotNeo provides a single HTTP request. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; those cleanup steps can be disabled individually. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the result with X-Page-Verdict and X-Billed headers.

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

See the ScreenshotNeo documentation for all options. cURL:

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
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,
)
r.raise_for_status()
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}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = Buffer.from(await res.arrayBuffer());
require('node:fs').writeFileSync('shot.webp', data);

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. Every plan includes its features; the Free plan provides 1,000 shots per month without a card, and paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

FAQ

Can JavaScript capture a tab without asking the user?

No. Chrome requires a user gesture, displays its own picker, and prompts for each request.

Does getDisplayMedia() take a PNG screenshot?

No. It returns a live MediaStream. Use a video frame and canvas for individual images, or use MediaRecorder for video.

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.

Can I force users to share only one particular window?

No. You can prefer a surface category or exclude monitors, but the user chooses the actual source in Chrome’s picker.

Should a normal website use chrome.tabCapture?

No. That API is for Chrome extensions. A regular website should use navigator.mediaDevices.getDisplayMedia().

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.