Skip to content

Commit

Permalink
Create manifest.json
Browse files Browse the repository at this point in the history
Fixes GoogleChrome#766

Create offscreen document, use WebRTC RTCDataChannel to send ArrayBuffer(s) from ServiceWorker to Web page.

Ideally this can be solved by programmatically setting WindowClient to arbitrary Web page, getting a reference to offscreen window, or setting opener on offscreen window for ability to use onmessage and postMessage(data, target, [data]) directly. 

RTCDataChannel send() does not transfer data. It does send ArrayBuffer(s) transferred from ServiceWorker to offscreen window to Web page window.
  • Loading branch information
guest271314 authored Nov 28, 2022
1 parent 2938c52 commit 33e2e1c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/transfer_offscreen_webrtc_web/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "ServiceWorker => WebRTC => Web page",
"version": "1.0",
"description": "ServiceWorker => WebRTC => Web page",
"manifest_version": 3,
"background": {
"service_worker": "background.js",
"type": "module"
},
"host_permissions": [
"*://*.github.com/*"
],
"permissions": [
"scripting",
"offscreen"
],
"externally_connectable": {
"matches": [
"*://*.github.com/*"
],
"ids": [
"*"
]
},
"action": {
"default_title": "ServiceWorker => WebRTC => Web page"
}
}

0 comments on commit 33e2e1c

Please sign in to comment.