chromium/third_party/blink/web_tests/http/tests/devtools/service-workers/resources/service-workers-bypass-for-network-cors-worker.js

let requests = [];

self.addEventListener('fetch', (event) => {
    requests.push({
        url: event.request.url,
        mode: event.request.mode
      });
  });

self.addEventListener('message', (event) => {
    event.data.port.postMessage(requests);
    requests = [];
  });