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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Use chrome.tabs.captureVisibleTab() in a Manifest V3 extension to capture exactly what is visible in the active tab’s viewport. The method returns a Promise that resolves to an image data URL. Request the activeTab permission for user-triggered captures (or the broader all_urls permission), pass the clicked tab’s windowId, and throttle calls to Chrome’s documented limit of two per second.

What captureVisibleTab captures

chrome.tabs.captureVisibleTab(windowId?, options?) captures the visible area of the currently active tab in the selected window. It captures the viewport, not the entire scrollable document, so content below the fold is excluded. The optional windowId identifies the target window; if omitted, Chrome uses the current window. The result is a string containing an image data URL, suitable for an <img> element, transfer to an extension page, conversion to a Blob, download, or upload.

What the image includes

  • Only pixels currently visible in the active tab’s viewport.
  • The page as rendered at the moment Chrome performs the capture, including the current zoom and device-scale rendering.
  • No content that requires scrolling to reveal.

What it does not do

  • It is not a full-page screenshot API.
  • It does not automatically scroll, stitch images, or capture an inactive tab.
  • It cannot bypass a page that has not loaded or a tab that is unavailable.

Permissions: activeTab or all_urls

The extension needs either activeTab or all_urls permission. For a button, command, or other user action that captures the tab the user is looking at, activeTab is the least-broad choice. Chrome grants temporary access to the invoked tab instead of asking for access to every site.

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.
Permission Use when Scope
activeTab Capture follows a user gesture, such as clicking the extension action Temporary access to the tab involved in that gesture
all_urls Your extension must capture matching tabs without a fresh user gesture Broad access to URLs covered by the permission

Special-page behavior matters. With activeTab, Chrome permits capture of chrome: pages, other extension pages, and data: URLs. A file: URL requires the user to grant the extension file access in Chrome’s extension settings. If the target tab is a restricted or unavailable page, handle the rejected Promise rather than assuming every tab is capturable.

#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

Minimal Manifest V3 implementation

Create an extension directory containing a manifest and service worker. This example captures after the user clicks the extension action.

manifest.json

{
  "manifest_version": 3,
  "name": "Visible Tab Capture",
  "version": "1.0.0",
  "permissions": ["activeTab"],
  "action": { "default_title": "Capture visible tab" },
  "background": { "service_worker": "service-worker.js" }
}

service-worker.js

chrome.action.onClicked.addListener(async (tab) => {
  try {
    const dataUrl = await chrome.tabs.captureVisibleTab(tab.windowId, {
      format: "png"
    });

    // Send to an extension page, store it, or use it as an image source.
    console.log(dataUrl);
  } catch (error) {
    console.error("Visible-tab capture failed", error);
  }
});

The Promise form is supported in Manifest V3 and later. The callback form remains the compatibility option for platforms that do not provide Promise support.

Load and try the extension

  1. Save both files in one directory.
  2. Open Chrome’s extensions page, enable Developer mode, choose Load unpacked, and select the directory.
  3. Open an ordinary web page, click the extension’s toolbar icon, and inspect the service worker console. The logged value begins with an image data-URL prefix.

Choosing capture options and handling the data URL

PNG, JPEG, and quality

Pass an options object to choose the image format. PNG is lossless and is a good default for text or interfaces. JPEG can reduce file size for photographic content; when using JPEG, provide a quality value appropriate for your workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const pngUrl = await chrome.tabs.captureVisibleTab(tab.windowId, {
  format: "png"
});

const jpegUrl = await chrome.tabs.captureVisibleTab(tab.windowId, {
  format: "jpeg",
  quality: 85
});

Display it in an extension page

The data URL can be assigned directly to an image element in a popup or other extension page. Keep the capture in extension-controlled code and send it using your normal extension messaging path.

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.
// popup.js
chrome.runtime.onMessage.addListener((message) => {
  if (message.type === "capture") {
    document.querySelector("img").src = message.dataUrl;
  }
});

For a download or upload, convert the data URL to a Blob first. Splitting at the comma separates the metadata from the base64 payload.

function dataUrlToBlob(dataUrl) {
  const [header, encoded] = dataUrl.split(",");
  const mime = header.match(/data:([^;]+)/)[1];
  const binary = atob(encoded);
  const bytes = Uint8Array.from(binary, char => char.charCodeAt(0));
  return new Blob([bytes], { type: mime });
}

Target-window behavior

In an action click listener, use tab.windowId so the capture targets the window containing the tab that the user selected. Omitting the argument is valid only when the current window is definitely the intended target.

// Explicit window (recommended in a click handler)
const image = await chrome.tabs.captureVisibleTab(tab.windowId, { format: "png" });

// Current window (use only when that is intentional)
const image2 = await chrome.tabs.captureVisibleTab(undefined, { format: "png" });

Capturing from commands or a custom UI

The same call works from a keyboard command, popup button, or another user-invoked extension surface. Query the active tab first when your event does not provide a tab object.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
async function captureActiveTab() {
  const [tab] = await chrome.tabs.query({ active: true, lastFocusedWindow: true });
  if (!tab || tab.windowId === undefined) {
    throw new Error("No active tab is available");
  }
  return chrome.tabs.captureVisibleTab(tab.windowId, { format: "png" });
}

Rate limits and performance

Chrome documents MAX_CAPTURE_VISIBLE_TAB_CALLS_PER_SECOND as two calls per second beginning with Chrome 92. Capturing is expensive, so periodic or burst features must throttle requests and tolerate delayed or rejected calls.

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.

A simple throttle

let lastCaptureAt = 0;
const MIN_INTERVAL_MS = 500; // two calls per second maximum

async function throttledCapture(windowId) {
  const wait = MIN_INTERVAL_MS - (Date.now() - lastCaptureAt);
  if (wait > 0) await new Promise(resolve => setTimeout(resolve, wait));
  lastCaptureAt = Date.now();
  return chrome.tabs.captureVisibleTab(windowId, { format: "png" });
}

For repeated captures, prefer a queue rather than launching many Promises at once. Stop work when the tab closes or changes, and avoid retaining large data URLs longer than necessary. JPEG may reduce transfer and storage size, while PNG generally preserves UI text more cleanly.

Troubleshooting

“activeTab or all_urls permission is required”

Add "activeTab" (or the intentionally broader "all_urls") to permissions in manifest.json, reload the unpacked extension, and invoke capture from a user action. Editing the manifest without reloading does not update a loaded extension.

The call works on websites but fails on a local file

Enable Allow access to file URLs for the extension on Chrome’s extensions page. Without that user setting, file: tabs are not available to the extension.

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

The image is blank or the Promise rejects

Check that the tab still exists, is the active tab in the supplied window, and has finished navigating. Restricted pages and transient navigation states can be unavailable. Log the complete error, retry after navigation settles, and present a useful message instead of repeatedly retrying at full speed.

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)

Captures are rejected during a burst

Apply the two-per-second throttle, serialize requests, and back off after a rejection. Do not run an unconstrained interval or fire-and-forget loop.

Nothing appears in the popup

Verify that the service worker actually sends the data URL to the popup, that the popup is open when you send it, and that the receiver assigns the value to img.src. For durable delivery, store the Blob or data URL and let the popup request it when opened.

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

When a browser extension is the wrong tool

captureVisibleTab requires a running Chrome extension and captures only the current viewport. For server-side screenshots, automated pipelines, PDFs, full-page captures, or AI-agent workflows, a screenshot API avoids browser setup.

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

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. A single request returns a PNG, JPEG, WebP, or PDF, with controls for full-page capture, lazy-loaded images, element selectors, device and viewport settings, dark mode, retina scale, custom CSS and JavaScript, clicks, waits, blocked resources, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous webhooks, bulk capture, usage reporting, and HTML/CSS rendering. Its 63 options accept the parameter names used by other screenshot APIs, which can simplify migration.

Best Value
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

Before capture, ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

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 documentation for request options. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to start.

FAQ

Does captureVisibleTab capture the whole page?

No. It captures only the visible viewport. A full-page result requires a separate scrolling-and-stitching design or a service that renders full pages.

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

Can I capture an inactive tab?

The API captures the currently active tab in the selected window. Switch the tab first, then capture, or use a server-side renderer for unattended pages.

Is the returned value a file path?

No. It is an image data URL. Use it as an image source or convert it to a Blob for storage, download, or upload.

Which permission is safer for a capture button?

activeTab is narrower because access follows the user’s invocation. Use all_urls only when your extension genuinely needs broad, non-interactive coverage.

Frequently Asked Questions

Can I capture a page while the user scrolls?

Capture the current viewport after each scroll position and manage your own stitching; captureVisibleTab does not provide scrolling or full-page assembly.

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

Does the API return PNG data by default?

Specify the desired format explicitly, such as format: "png" or format: "jpeg", so your output workflow is predictable.

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
$35.90
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
Bestseller 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
$69.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.