Web capture is the browser-authorized capture of a tab, window, or monitor as a live media stream. Developers start it with navigator.mediaDevices.getDisplayMedia(), then preview the stream, record it, or send it to other people with WebRTC. The browser—not the website—lets the user choose what to share and approve the capture.
This is different from taking a screenshot of a web page. Display capture produces a live video stream of a user-selected screen surface; a screenshot API captures a page as an image or PDF without asking someone to share their desktop.
What web capture means
In this article, web capture means browser display capture: a person chooses a browser tab, application window, or display, and the browser provides the selected surface to the site as a MediaStream. The main entry point is navigator.mediaDevices.getDisplayMedia().
The stream normally contains video. The user may also be able to share audio, depending on the browser, operating system, and selected source. The web application can show the stream in a video element, record it locally, or transmit it to other participants.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- 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
Display capture is not a screenshot
A screenshot is a still image of a page or screen at a particular moment. Display capture is a continuing stream: frames arrive while sharing is active, so an application can preview, record, or transmit them. It also differs from taking a screenshot of a page on a server. A web page cannot use display capture to silently choose and read a visitor’s screen.
How the capture flow works
- The user starts sharing. A button or other clear action in the page calls
getDisplayMedia()from a user interaction. - The browser presents its picker. The user chooses an available tab, window, or display and grants permission. The page cannot force a particular source or bypass the browser’s selection UI.
- The promise returns a stream. If the user approves, the promise resolves to a
MediaStream, typically with a video track and, if available and selected, an audio track. - The application uses the stream. It can set the stream as a video preview’s source, pass it to
MediaRecorder, or send it through a real-time media connection such as WebRTC. - Sharing ends visibly. The app should make the active state clear and stop its tracks when the user ends the session or the feature no longer needs the stream.
Build a simple display-capture preview
The following standalone example starts capture from a button, previews the selected surface, reports whether the browser returned an audio track, and lets the user stop sharing. Serve it from a secure context such as HTTPS or localhost; display capture is not available in ordinary insecure contexts in supporting browsers.
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Display capture preview</title>
<h1>Share a tab, window, or screen</h1>
<p id="status" role="status">Not sharing.</p>
<button id="start" type="button">Choose what to share</button>
<button id="stop" type="button" disabled>Stop sharing</button>
<video id="preview" autoplay muted playsinline controls></video>
<script>
const startButton = document.querySelector('#start');
const stopButton = document.querySelector('#stop');
const preview = document.querySelector('#preview');
const status = document.querySelector('#status');
let stream;
function stopCapture() {
if (stream) {
stream.getTracks().forEach(track => track.stop());
stream = undefined;
}
preview.srcObject = null;
startButton.disabled = false;
stopButton.disabled = true;
status.textContent = 'Not sharing.';
}
startButton.addEventListener('click', async () => {
if (!navigator.mediaDevices?.getDisplayMedia) {
status.textContent = 'Display capture is not available in this browser or context.';
return;
}
try {
// The browser still asks the user to choose a source and approve capture.
stream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: false
});
preview.srcObject = stream;
startButton.disabled = true;
stopButton.disabled = false;
const hasAudio = stream.getAudioTracks().length > 0;
status.textContent = hasAudio
? 'Sharing is active, with an audio track.'
: 'Sharing is active, without an audio track.';
// Also update the page if the user stops sharing through browser controls.
stream.getVideoTracks()[0]?.addEventListener('ended', stopCapture, { once: true });
} catch (error) {
status.textContent = error.name === 'NotAllowedError'
? 'Sharing was cancelled or permission was denied.'
: `Could not start sharing: ${error.message}`;
}
});
stopButton.addEventListener('click', stopCapture);
</script>
</html>
In a production interface, explain the capture scope before opening the picker, keep an obvious stop control available, and make the preview and sharing state easy to understand. This example requests video only. Requesting audio does not guarantee an audio track; support and available choices vary.
Record the selected display locally
To create a recording rather than only previewing the stream, pass it to MediaRecorder. The basic pattern below collects encoded chunks and exposes a download link when recording stops. The exact recording MIME type is browser-dependent, so check support rather than assuming one codec works everywhere.
const stream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: false
});
const preferredType = 'video/webm;codecs=vp9';
const options = MediaRecorder.isTypeSupported(preferredType)
? { mimeType: preferredType }
: undefined;
const recorder = new MediaRecorder(stream, options);
const chunks = [];
recorder.addEventListener('dataavailable', event => {
if (event.data.size > 0) chunks.push(event.data);
});
recorder.addEventListener('stop', () => {
const blob = new Blob(chunks, { type: recorder.mimeType || 'video/webm' });
const link = document.createElement('a');
const objectUrl = URL.createObjectURL(blob);
link.href = objectUrl;
link.download = 'screen-recording.webm';
link.textContent = 'Download recording';
document.body.append(link);
link.addEventListener('click', () => {
setTimeout(() => URL.revokeObjectURL(objectUrl), 0);
}, { once: true });
});
// Start after capture has been granted. Call recorder.stop() when done,
// then stop the capture tracks when the session is finished.
recorder.start();
Wire recording controls into the same lifecycle as the preview: stop the recorder, stop all capture tracks, and clean up any object URLs when the recording is no longer needed. Keep the capture indicator visible while recording is active.
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
Send a captured screen over WebRTC
For live screen sharing, use the captured video track as a sender in a WebRTC connection. The signaling exchange that connects peers is application-specific; the essential media step is to add the capture track to an established or negotiating peer connection:
const stream = await navigator.mediaDevices.getDisplayMedia({ video: true });
for (const track of stream.getVideoTracks()) {
peerConnection.addTrack(track, stream);
}
The receiving application handles the resulting remote stream like other WebRTC media and can attach it to a video element. A production implementation also needs signaling, connection-state handling, and a way to stop or replace the outgoing track. Do not treat successful local capture as proof that remote delivery is working.
Permissions, privacy, and safe interface design
Display capture is powerful because it can reveal material outside the current page. A selected desktop or window might show private chats, account details, customer records, notifications, or password-manager content. Even a tab can contain information the person did not mean to expose. Capture of a logical surface can also include content that is not currently visible in the viewport.
Recommended Free Tools
- Ask at the moment of need. Start capture from an explicit user action, not automatically on page load.
- Explain the choice. Tell the user whether they are about to share a tab, window, or full display; the browser’s own picker remains responsible for source selection.
- Show active state and preview. Make it clear when capture is running and what the application is receiving.
- Provide an obvious stop action. Stop every track owned by the capture session when the user ends sharing or leaves the workflow.
- Handle browser-side stopping. The user can stop sharing through browser controls; listen for a track’s
endedevent and update the interface. - Limit onward exposure. If you record or transmit the stream, explain that separately and apply the application’s normal access, retention, and privacy controls.
Browsers require a secure context in implementations that support the API, and a recent user interaction is required. They also show an indication that sharing is active. These protections do not remove the application’s responsibility to make sharing understandable and to avoid retaining or transmitting data unexpectedly.
Audio and browser support
Video is the central output of the documented display-capture workflow. Audio is optional, and whether the picker offers tab, window, or system audio depends on browser and operating-system support. Code should inspect the returned stream for audio tracks instead of treating an audio request as a promise that audio will be present.
Rank #3
- 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.
MDN classifies getDisplayMedia() as having limited availability, meaning it is not supported in some widely used browsers. Check the capability at runtime, test the browser and operating-system combinations your users rely on, and provide a useful fallback message. Do not make a blanket compatibility promise based on one browser.
Choose the right capture approach
| Need | Approach | What it provides |
|---|---|---|
| Show a person-selected tab, window, or display live | getDisplayMedia() |
A user-authorized MediaStream for preview, recording, or transmission. |
| Save a live session as a recording | getDisplayMedia() with MediaRecorder |
A recording assembled from encoded chunks; supported formats vary by browser. |
| Share live with remote participants | getDisplayMedia() with WebRTC |
A local capture stream whose tracks can be sent through a real-time connection. |
| Get a still image or PDF of a web page without desktop sharing | A website screenshot API | A page capture, not an interactive user’s live display stream. |
Use display capture when the user needs to share what is on a screen in real time, including activity that a page-only renderer cannot see. Use a page screenshot service when the task is to capture a URL as an image or PDF without opening a browser picker on the user’s device.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Or skip the browser setup
If the goal is a still screenshot or PDF of a web page—not a live stream of someone’s screen—ScreenshotNeo is a website screenshot API and MCP server. It captures a URL with one GET request. Cookie banners, newsletter popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.
For example, this cURL request saves a screenshot of Stripe as a WebP file. See the ScreenshotNeo API documentation for options and setup.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Sign up for ScreenshotNeo and get 1,000 free screenshots a month with no card.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting display capture
The API is missing or capture fails immediately
Check that the page is served in a secure context and that navigator.mediaDevices.getDisplayMedia exists. If it does not, the browser or current context does not expose the feature. Show a graceful fallback rather than calling the method unconditionally.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #4
- 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 picker never appears
Call the method directly from a recent user gesture, such as a click handler. Do not rely on a timer or a page-load callback to trigger the browser’s permission and source-selection flow.
The user cancels or denies sharing
The promise can reject when the user dismisses the picker or denies the request. Handle the rejection and leave the page usable; cancellation is a normal outcome, not necessarily an application fault.
There is no audio
Audio availability varies. Check stream.getAudioTracks() after permission succeeds, communicate when the session is video-only, and test the actual browser and operating-system combinations you support.
The preview or remote share stops unexpectedly
The user may have stopped capture using browser controls. Listen for the video track’s ended event, update the sharing state, and stop or renegotiate the remote sender as appropriate for your application.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, 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 minuteA recording cannot be played
Do not assume every browser supports the same recording format. Use MediaRecorder.isTypeSupported() to select a supported MIME type where possible, and test playback in the destinations where recordings will be used.
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.
Performance and reliability considerations
Display capture is a live media workflow, so its practical cost depends on the selected surface, frame changes, browser, device, and what the application does with the stream. Recording adds encoding and storage work; transmitting adds network and peer-connection constraints. The API itself does not guarantee a particular frame rate, latency, recording format, or remote quality.
Build for interruption: users can cancel before capture begins, stop capture at any time, or switch workflows. Track the state of the stream and peer connection separately, release tracks when finished, and test under the real conditions your product needs—including the browser and operating system combinations, audio requirements, recording duration, and network conditions relevant to your users.
Standards status and newer capture controls
The W3C Screen Capture document relevant to this topic is a Working Draft published on 16 July 2026. Its status says it is incomplete, may change substantially, and is not intended for implementation as-is. Treat stable browser behavior as the practical implementation target rather than assuming every proposal in a draft is available.
Region Capture, Element Capture, and Captured Surface Control are newer or separate capture-related controls. They are not substitutes for checking actual browser support, and their mention in standards work does not establish that a particular browser implements them. Keep the core user-selected display flow distinct from such evolving capabilities.
Frequently Asked Questions
Can a website start recording my screen without asking?
No. Browser display capture requires a user gesture and browser-controlled source selection and permission. The user can also stop sharing through browser controls.
Does web capture capture only the current website?
Not necessarily. The user selects a tab, window, or display in the browser picker, so the captured surface can extend beyond the current page.
Can I capture one HTML element with getDisplayMedia()?
The core flow captures a user-selected display surface. Element-level or region controls are separate capabilities and should not be assumed available across browsers.
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 errorsQuick 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.

