Stay organized with collections Save and categorize content based on your preferences.
DescriptionThe Desktop Capture API captures the content of the screen, individual windows, or individual tabs.
PermissionsdesktopCapture
Enum used to define set of desktop media sources used in chooseDesktopMedia().
Enum"screen"
"window"
"tab"
"audio"
"system"
"window"
"exclude"
chrome.desktopCapture.cancelChooseDesktopMedia(
desktopMediaRequestId: number,
): void
Hides desktop media picker dialog shown by chooseDesktopMedia().
ParametersdesktopMediaRequestId
number
Id returned by chooseDesktopMedia()
chrome.desktopCapture.chooseDesktopMedia(
sources: DesktopCaptureSourceType[],
targetTab?: Tab,
callback: function,
): number
Shows desktop media picker UI with the specified set of sources.
ParametersSet of sources that should be shown to the user. The sources order in the set decides the tab order in the picker.
Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches tab.url
. The tab's origin must be a secure origin, e.g. HTTPS.
The callback
parameter looks like:
(streamId: string, options: object) => void
An opaque string that can be passed to getUserMedia()
API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId
. The created streamId
can be used only once and expires after a few seconds when it is not used.
Contains properties that describe the stream.
canRequestAudioTrack
boolean
True if "audio" is included in parameter sources, and the end user does not uncheck the "Share audio" checkbox. Otherwise false, and in this case, one should not ask for audio stream through getUserMedia call.
An id that can be passed to cancelChooseDesktopMedia() in case the prompt need to be canceled.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-11 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4