Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

299
Vistas
Service worker runs in browser (chrome) but fails to register in Android WebView?

So currently, i'm working with an app that is written in react and has a service worker script. It is rendered on a Honeywell CT40 device via an Android hardware abstraction layer through a webview in the android/java code. Everything seems to work fine in the chrome browser when running the react app only. However, when the android app runs and renders the app, the service worker fails to register. The only error message I get on the chrome logs are:

Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js' failed to load.

This error only occurs when visiting the app through the android app via webview, but when using the browser directly, no issues.

Any thoughts?

WebView version: 79.0.3945.116

WebView version: com.android.chrome

Again, this works as expected in the browser itself, just not in the android webview browser it seems. Any idea? Attached are screenshots. Below is a code sample of where the service worker script starts. As stated in the documentation here: https://developer.chrome.com/docs/workbox/modules/workbox-sw/

    /* eslint-disable */

    importScripts(
      'https://storage.googleapis.com/workbox- 
   cdn/releases/5.1.2/workbox-sw.js'
);

let window = self
importScripts('/__ENV_FILE__.js')
workbox.setConfig({
  debug: window.$$.APP_WORKBOX_CONFIG_DEBUG || false
})

const { precacheAndRoute, createHandlerBoundToURL } = workbox.precaching
const { NavigationRoute, registerRoute } = workbox.routing
const { NetworkOnly } = workbox.strategies
const { Queue } = workbox.backgroundSync

// Injection point of precache assets
precacheAndRoute(self.__WB_MANIFEST)

self.addEventListener('message', (event) => {
  if (event.data && event.data.type === 'SKIP_WAITING') {
    self.skipWaiting()
  }
})

error 1

error 2

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda