https://github.com/krgn/shared-worker-experiment
Account for Connections to SharedWorker and broadcast messages between Clients
https://github.com/krgn/shared-worker-experiment
Last synced: over 1 year ago
JSON representation
Account for Connections to SharedWorker and broadcast messages between Clients
- Host: GitHub
- URL: https://github.com/krgn/shared-worker-experiment
- Owner: krgn
- Created: 2015-11-25T14:53:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-26T08:31:36.000Z (over 10 years ago)
- Last Synced: 2025-01-26T04:43:50.732Z (over 1 year ago)
- Language: HTML
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SharedWorker Example
This example demonstrates how to account for connections to a SharedWorker
instance between tabs/windows.
We use the 'unload' event on the window to signal the worker that the connection
is not needed anymore and notify other windows of it.
The curious thing seems to be, that at the time of this writing, the
initialization function needs to be wrapped in `setTimeout` in order to function
properly, even with a timeout value of 0!