Using getDisplayMedia inside of Offscreen Document won't focus/select target tab.

156 views
Skip to first unread message

Messiah Cheng

unread,
Nov 9, 2023, 10:28:10 AM11/9/23
to Chromium Extensions
Hello everyone, please help me, I'm make a screen recorder chrome extension and met this big question.

Inside of normal html document, using getDisplayMedia will auto focus the target tab, while inside offscreen document it doesn't work.

Maybe i can use chrome.tabs.update to select the target tab, but it's so sad that i can't access the tab id of mediaStream which return by getDisplayMedia...

Patrick Kettner

unread,
Nov 28, 2023, 12:54:21 AM11/28/23
to Messiah Cheng, Chromium Extensions
Hi Messiah!
It looks like this is a relatively long standing issue - crbug.com/1275989. However, as a result of your message I was able to dig in a bit and locate the specific CL that introduced the problem. You can star that issue to raise it's priority and follow along with progress. Since it is a web API (rather than an extension specific one) I don't believe there is a clear way to associate the selected tab MediaStream with a tabID (the later of which is an extension specific concept). You could open a feature request with the WICG to start discussion around supporting it, but I think getting the above bug fixed is likely the best path forward.

patrick 

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/2253ef27-907a-4589-a8d4-4099fdc81c3cn%40chromium.org.
Reply all
Reply to author
Forward
0 new messages