summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/support/iframe-sw-shared-name.html
blob: c1c7a536e13ed59f950b953be32c9fdc91538f4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<title>Iframe for cross-origin Shared Worker</title>
<script src="/common/get-host-info.sub.js"></script>

<body>
<script>

const worker_url = new URL(
  'shared-name.js',
  get_host_info().ORIGIN + self.location.pathname);

let worker = new SharedWorker(worker_url);
worker.port.onmessage = e => {
  parent.postMessage(e.data, '*');
}

</script>
</body>
</html>