mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
* Add tabCapture sample * Add README * Update receiver.html * Fix variable loss caused by idle * Use windows.create * Remove unnecessary logs * Update README * Update api-samples/tabCapture/README.md Co-authored-by: Oliver Dunk <oliver@oliverdunk.com> * Update api-samples/tabCapture/README.md Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com> * Update api-samples/tabCapture/README.md Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com> * Update api-samples/tabCapture/README.md Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com> * Rename background.js * Remove unnecessary async function * Move the script to the body * Update api-samples/tabCapture/README.md Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com> * Update README.md * Update api-samples/tabCapture/manifest.json Co-authored-by: Oliver Dunk <oliver@oliverdunk.com> --------- Co-authored-by: Oliver Dunk <oliver@oliverdunk.com> Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
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
Use 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.