Search code examples
google-chrome-extension

Chrome API chrome.desktopCapture.chooseDesktopMedia - How to get the id of selected tab?


I am using desktopCapture.chooseDesktopMedia with only ["tab"] option to choose the tab to be streamed. After making the selection, chrome doesn't automatically switch to the selected tab. How can I get the tab ID that was selected so that I can make it active? I only receive a stream ID in the callback.


Solution

  • Good question, but reading the docs seems to suggest you don't get that information in any way, nor can you change the flow to having the user select the tab first and then offering only that tab for capture.

    Might be a candidate for a feature request over at https://crbug.com/