Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

301
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!