Until this deprecation, a service worker could use importScripts() to import any script at any time. After this change, a service worker can only importScripts() in two cases: - Before installation finishes (from the initial execution of the service worker until it reaches the `installed` state). - After installation finishes, only for scripts that were already imported in the previous phase.

Specification

Specification link


Specification being incubated in a Community Group

Status in Chromium

Blink>ServiceWorker


Removed (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • Positive
  • Positive
  • No signal
  • No signals

Owner

Search tags

service worker, service, worker, import, script, importScripts, importScript,

Last updated on 2020-11-09