@rysiek looks like the newest webkit is supporting transferring RTCDataChannel to a service worker: https://wpt.fyi/results/webrtc-extensions/transfer-datachannel-service-worker.https.html?label=experimental&label=master&aligned although I imagine that’s not very useful atm, since other browsers completely lack support, and RTC connections cannot be created in the worker itself at any case
you’re probably already familiar with the relevant webrtc issue: https://github.com/w3c/webrtc-pc/issues/230 which explicitly highlights peer-to-peer content delivery as a use-case. interestingly, the last comment says that transferring to a service worker is not yet implemented even in safari, but things seem to have changed since then according to wpt
unfortunately, google seems to have blessed their http3-only webtransport https://web.dev/webtransport/#is-webtransport-an-alternative-to-webrtc-data-channels as a way to open datagram connections in workers, which doesn’t support peer-to-peer connections at all. so I wouldn’t hold my breath for service worker webrtc support in chrome
@kristof @midzer @fribbledom
> btw, this is a bit silly, but could a service worker just use sendmessage to communicate with the main page which hosts an RTCDataChannel in lieu of instantiating an RTCDataChannel itself?
In general terms: sure, this is actually used by an js-ipfs example somewhere.
Specifically for my project: no, the point is to have a way to fetch content even before any HTML is loaded (provided that the SW has been installed before):
mastodon.technology is shutting down by the end of 2022. Please migrate your data immediately. This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!