blob: 3cfbe7c6e4ca8e2b813dcfec9e8a30c9a6463054 [file] [log] [blame]
// Import a remote origin script.
const import_url =
'http://{{domains[www1]}}:{{ports[http][0]}}/workers/modules/resources/export-credentials.py';
if ('DedicatedWorkerGlobalScope' in self &&
self instanceof DedicatedWorkerGlobalScope) {
import(import_url)
.then(module => postMessage(module.cookie));
} else if (
'SharedWorkerGlobalScope' in self &&
self instanceof SharedWorkerGlobalScope) {
onconnect = e => {
import(import_url)
.then(module => e.ports[0].postMessage(module.cookie));
};
}