async function getDevServerResponse (url) {
    // point it to the dev server
    url.protocol = 'http:'
    url.host = 'localhost'
    url.port = devServerPort

    // ensure we have a fresh version of the response
    url.searchParams.set('t', Date.now())

    // fetch the requested resource
    const request = await fetch(
      url.href.replace(hrefRE, '')
    )

    // and return it wrapped as if it comes from the extension
    return new Response(request.body, {
      headers: {
        'Content-Type': request.headers.get('Content-Type') || 'text/javascript',
        'Cache-Control': request.headers.get('Cache-Control') || ''
      }
    })
  }
We intercept all fetch requests from the extension page and redirect them to the dev server
for HMR purposes.