summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/storage-access-api/resources/shared-worker-relay.js
blob: c94acefec999cef61e16d49fcfb529fe60e7b98f (plain)
1
2
3
4
5
6
7
8
9
10
// This worker relays any messages received to the first connection.
let port;
self.onconnect = (e) => {
    if (port == undefined) {
        port = e.ports[0];
    }
    e.ports[0].onmessage = (e) => {
        port.postMessage(e.data);
    }
}