diff options
Diffstat (limited to 'testing/web-platform/tests/fetch/private-network-access/resources/worker-fetcher.html')
-rw-r--r-- | testing/web-platform/tests/fetch/private-network-access/resources/worker-fetcher.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fetch/private-network-access/resources/worker-fetcher.html b/testing/web-platform/tests/fetch/private-network-access/resources/worker-fetcher.html new file mode 100644 index 0000000000..bd155a532b --- /dev/null +++ b/testing/web-platform/tests/fetch/private-network-access/resources/worker-fetcher.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Worker Fetcher</title> +<script> + window.addEventListener("message", function (evt) { + let { url } = evt.data; + + const worker = new Worker(url); + + worker.addEventListener("message", (evt) => { + parent.postMessage(evt.data, "*"); + }); + + worker.addEventListener("error", (evt) => { + parent.postMessage({ error: evt.message || "unknown error" }, "*"); + }); + }); +</script> |