Skip to content
recorder.tools

How Browser Screen Recording Works (and Why Nothing Needs Uploading)

How getDisplayMedia, getUserMedia and MediaRecorder work, what a site can see when you share your screen, and why recordings never need uploading.

By . Updated . 5 min read.

Diagram of a screen stream and a microphone stream flowing into a browser recorder and out to a file on disk

A few years ago, recording your screen meant installing an app or a browser extension. Today every major desktop browser can do it on its own, through standard web APIs. Understanding how those APIs work explains both what browser recorders can do and why a well-built one never needs to upload your recording.

This article is written for curious users and web developers alike. The code samples are deliberately minimal.

The three building blocks

Browser recording uses three APIs that are part of the web platform:

  1. getDisplayMedia() asks the person to choose a screen, window or tab to share, and returns it as a live video stream.
  2. getUserMedia() returns a live stream from a camera or microphone.
  3. MediaRecorder takes any live stream and encodes it into a compressed file, such as WebM or MP4.

A screen recorder is essentially those three, wired together:

const screen = await navigator.mediaDevices.getDisplayMedia({ video: true, audio: true });
const recorder = new MediaRecorder(screen);
const chunks = [];

recorder.ondataavailable = (e) => chunks.push(e.data);
recorder.onstop = () => {
  const file = new Blob(chunks, { type: recorder.mimeType });
  const url = URL.createObjectURL(file); // a local address, valid only in this tab
  // offer `url` as a download link
};

recorder.start(1000); // hand over data every second

Everything in that snippet happens inside the browser tab. The video frames go from the operating system to the browser to the encoder, and the result sits in the tab's memory as a Blob. Nothing in this flow involves a server.

The person stays in control

getDisplayMedia() was designed so that a website can never capture your screen silently:

  • It requires a user action. Browsers only allow the call in response to something like a click.
  • The browser chooses what is shared, not the website. The sharing dialog belongs to the browser. A website can express preferences but cannot select a window on your behalf.
  • Sharing is visible. Browsers show an indicator while a screen is shared, with a button to stop sharing at any time.
  • It requires a secure connection. These APIs only work on HTTPS pages (and on localhost for development).

Camera and microphone access through getUserMedia() follow similar rules, with a permission prompt per site that the person can revoke from the address bar.

Tab, window or screen

The choice made in the dialog changes what is captured:

Shared surfaceWhat the stream contains
Browser tabOnly that tab's content, even if other windows cover it; tab audio where supported
WindowThat one application window
Entire screenEverything visible on that display, including notifications and pop-ups

Some browsers support hints such as preferCurrentTab, selfBrowserSurface and systemAudio that influence which options the dialog offers. Chromium-based browsers also offer Region Capture and Element Capture, which let a page crop a capture of its own tab to a specific area.

Audio: one recording, several sources

A recording file normally carries one audio track, but a screen recorder may have two sources: the shared audio and the microphone. The solution is to mix them with the Web Audio API before recording:

const ctx = new AudioContext();
const mix = ctx.createMediaStreamDestination();
ctx.createMediaStreamSource(screen).connect(mix);
ctx.createMediaStreamSource(microphone).connect(mix);

const combined = new MediaStream([
  ...screen.getVideoTracks(),
  ...mix.stream.getAudioTracks(),
]);
new MediaRecorder(combined).start();

This is exactly how the recorder.tools screen recorder combines your voice with the sound of a shared tab. Which computer sounds are available at all depends on the browser and operating system; how to screen record with audio has the full table.

Choosing a format

MediaRecorder.isTypeSupported() tells a page which formats the browser can encode. WebM with VP8 or VP9 is the long-standing default in Chrome, Edge and Firefox. Safari records MP4, and recent versions of Chrome and Edge can as well. A good recorder checks support first and falls back gracefully. WebM vs MP4 compares the two.

Where the recording lives

With the approach above, recorded data accumulates in memory until the person downloads it. Two consequences follow:

  • Close or reload the tab and the recording is gone. That is the privacy guarantee and also the main risk, which is why careful recorders warn before you leave a page with an unsaved recording.
  • Very long recordings use a lot of memory. Browsers encode at a few megabits per second by default, so an hour of screen recording can occupy several hundred megabytes to over a gigabyte, more for busy, high-motion content. On machines with little free memory, saving long sessions in parts is safer. Chromium-based browsers also offer the File System Access API, which lets a page stream data straight to a file the person chooses.

Screenshots use the same machinery

A browser screenshot tool calls getDisplayMedia(), draws a single frame of the stream onto a canvas, encodes it as PNG, and immediately stops the stream. The screenshot tool works this way, and captures at the full resolution the browser shares, which on high-density displays is larger than the size you see on screen.

What a recording website can and cannot see

  • It can see only what you choose in the browser's dialog, and only while sharing is active.
  • It cannot see other tabs, windows or screens you did not pick, your files, or anything after you stop sharing.
  • It can upload what it records, if it is built to. Browser APIs do not prevent that. This is why it matters whether a recorder sends data to a server. Recorders that process everything locally never need to.

You can verify a site's behaviour yourself: open the browser's developer tools, switch to the Network tab, record something, and watch whether any large upload appears.

Limits of browser recording

  • No screen recording on phones. Mobile browsers do not support getDisplayMedia(); phones have their own built-in recorders.
  • System audio support varies by browser and operating system.
  • No access below the browser. A web page cannot record a protected video that the operating system blocks from capture, and cannot hide the sharing indicator.

Within those limits, the browser is now a capable, private recording studio: no install, no account, and no copy of your recording anywhere except the file you save.

Written by

Full-stack developer and creator of recorder.tools. Builds the recorders on this site and writes these guides after testing each one across browsers and operating systems.

Related guides