Skip to content Skip to sidebar Skip to footer

Can I Call A Method From An External Js File In A Serviceworker?

Is it possible to call a function from a JavaScript file out of an ServiceWorker? Directory root static js serviceworker.js tmpBuild js pages

Solution 1:

You can use importScripts() https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts

importScripts('https://example.com/script.js');

Post a Comment for "Can I Call A Method From An External Js File In A Serviceworker?"