chromium/third_party/blink/web_tests/external/wpt/storage-access-api/resources/shared-worker-relay.js

// 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);
    }
}