diff options
Diffstat (limited to 'testing/web-platform/tests/workers/modules/resources/static-import-remote-origin-credentials-checker-worker.sub.js')
-rw-r--r-- | testing/web-platform/tests/workers/modules/resources/static-import-remote-origin-credentials-checker-worker.sub.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/web-platform/tests/workers/modules/resources/static-import-remote-origin-credentials-checker-worker.sub.js b/testing/web-platform/tests/workers/modules/resources/static-import-remote-origin-credentials-checker-worker.sub.js new file mode 100644 index 0000000000..c543cb4961 --- /dev/null +++ b/testing/web-platform/tests/workers/modules/resources/static-import-remote-origin-credentials-checker-worker.sub.js @@ -0,0 +1,12 @@ +// Import a remote origin script. +import * as module from 'http://{{domains[www1]}}:{{ports[http][0]}}/workers/modules/resources/export-credentials.py'; +if ('DedicatedWorkerGlobalScope' in self && + self instanceof DedicatedWorkerGlobalScope) { + postMessage(module.cookie); +} else if ( + 'SharedWorkerGlobalScope' in self && + self instanceof SharedWorkerGlobalScope) { + onconnect = e => { + e.ports[0].postMessage(module.cookie); + }; +} |