onMessage = message => {
    if (message === 'qbex:hmr:hello') {
      console.log(`${ banner } Connected to background`)
      return
    }

    if (message === 'qbex:hmr:reload-content') {
      console.log(`${ banner } Reload requested by background...`)
      scriptIsReloading = true

      // reload the page with a small delay,
      // to allow the extension to be also reloaded
      setTimeout(() => {
        window.location.reload()
      }, 100)
    }
  }
Only run these in development mode and in Chrome.
Only Chrome allows the background counterpart initialization
to take place in a service worker.