Trying to use window.fetch() from a service worker throws a ReferenceException saying that window is undefined.
The fetch() function itself is available within a service worker since it works when declared like so:
external fun fetch(input: dynamic, init: RequestInit = definedExternally): Promise = definedExternally
What is the rationale then for fetch() being defined as a function inside of window if window is not available in all contexts that fetch is available in?
Or is there a different way I should be calling fetch from within a service worker?