WebRTC in the background

323 views
Skip to first unread message

T S

unread,
Aug 26, 2022, 6:42:30 AM8/26/22
to Chromium Extensions
Let's pretend the Chromium team come around and we get some way of maintaining a persistent connection like a Websocket in a service worker / something else analogous to a background script.

I'd like to be able to leverage WebRTC in the background - not for media streams, but for peer to peer data communication.  Service workers don't have access to the browser-provided Window, so can't easily create their own RTCPeerConnections.  

It's looking like this isn't an option, but just in case, does anyone know a way to get a working RTCPeerConnection in a service worker?  Make one in a content script and pass it in somehow, perhaps?

Otherwise, I suppose I'm looking at having the extension maintain a permanently pinned tab, which isn't going to be a great experience but might work for now.

Yuan Ho

unread,
Sep 13, 2022, 5:04:50 AM9/13/22
to Chromium Extensions, T S
I am having exactly the same problem while migrating to MV3.
Reply all
Reply to author
Forward
0 new messages