Source code

Revision control

Copy as Markdown

Other Tools

// Import a remote origin script.
if ('DedicatedWorkerGlobalScope' in self &&
self instanceof DedicatedWorkerGlobalScope) {
self.onmessage = e => {
e.target.postMessage(module.importedModules);
};
} else if (
'SharedWorkerGlobalScope' in self &&
self instanceof SharedWorkerGlobalScope) {
self.onconnect = e => {
e.ports[0].postMessage(module.importedModules);
};
} else if (
'ServiceWorkerGlobalScope' in self &&
self instanceof ServiceWorkerGlobalScope) {
self.onmessage = e => {
e.source.postMessage(module.importedModules);
};
}