I have a website which has a service worker like:
// Import a script from another domain
importScripts('
https://example.com/script.js')
Suppose that script.js is updated with some new code and the service worker is activated due to a push event (the user is the meantime has not visited my website again).
Does importScripts checks for updates each time the service worker is activated or it downloads the script.js just once when the service worker is first installed?
Is there any way to have the service worker code (and in particular the imported scripts) refreshed each time the service worker receives a push message?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)