blob: c2b0bcb8bfb0aa0a7607143840f1f56a38d8b0a3 (
plain)
1
2
3
4
5
6
7
8
9
|
if ('DedicatedWorkerGlobalScope' in self &&
self instanceof DedicatedWorkerGlobalScope) {
postMessage('dedicated worker script loaded');
} else if ('SharedWorkerGlobalScope' in self &&
self instanceof SharedWorkerGlobalScope) {
self.onconnect = evt => {
evt.ports[0].postMessage('shared worker script loaded');
};
}
|