chromium/content/test/data/service_worker/create_service_worker_from_coop.html

<html>
<title>create service worker</title>
<script>
  async function register(worker_url, scope) {
    try {
      const init = scope ? {scope} : {};
      await navigator.serviceWorker.register(worker_url, init);
      await navigator.serviceWorker.ready;
      return 'DONE';
    } catch (error) {
      return `${error}`;
    }
  }
</script>
</html>