mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
1.1 KiB
1.1 KiB
chrome.tabCapture
A sample that demonstrates how to use the chrome.tabCapture API.
Overview
In this sample, the chrome.tabCapture API captures the contents of the active tab. The captured stream is displayed in a new window.
Implementation Notes
Call tabCapture.getMediaStreamId() to capture specific tabs.
The targetTabId and consumerTabId are obtained in the Service Worker, and then passed to the receiver page through the tabs.sendMessage() method.
See the Audio recording and screen capture guide for a more detailed implementation.
Running this extension
- Clone this repository.
- Load this directory in Chrome as an unpacked extension.
- Click the extension's action icon.