Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow inspection of specific shared workers (#20389)
- Loading branch information
1 parent
712d77d
commit 2f03d39
Showing
9 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# SharedWorkerInfo Object | ||
|
||
* `id` String - The unique id of the shared worker. | ||
* `url` String - The url of the shared worker. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<html> | ||
<body> | ||
<script> | ||
const { ipcRenderer } = require('electron') | ||
|
||
const worker1 = new SharedWorker('./shared-worker1.js') | ||
const worker2 = new SharedWorker('./shared-worker2.js') | ||
|
||
worker1.port.start() | ||
worker2.port.start() | ||
|
||
const promise1 = new Promise(resolve => { | ||
worker1.port.onmessage = resolve | ||
}) | ||
|
||
const promise2 = new Promise(resolve => { | ||
worker2.port.onmessage = resolve | ||
}) | ||
|
||
Promise.all([promise1, promise2]).then(() => { | ||
ipcRenderer.send('ready') | ||
}) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
self.onconnect = function (e) { | ||
const port = e.ports[0] | ||
port.postMessage('ready') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
self.onconnect = function (e) { | ||
const port = e.ports[0] | ||
port.postMessage('ready') | ||
} |