WindowOrWorkerGlobalScope

The WindowOrWorkerGlobalScope mixin describes several features common to the Window and WorkerGlobalScope interfaces. Each of these interfaces can, of course, add more features in addition to the ones listed below.

Note: WindowOrWorkerGlobalScope is a mixin and not an interface; you can't actually create an object of type WindowOrWorkerGlobalScope.

Properties

These properties are defined on the WindowOrWorkerGlobalScope mixin, and implemented by Window and WorkerGlobalScope.

WindowOrWorkerGlobalScope.caches Read only
Returns the CacheStorage object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests.
WindowOrWorkerGlobalScope.crossOriginIsolated Read only
Returns a boolean value that indicates whether a SharedArrayBuffer can be sent via a Window.postMessage() call.
WindowOrWorkerGlobalScope.indexedDB Read only
Provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an IDBFactory object.
WindowOrWorkerGlobalScope.isSecureContext Read only
Returns a boolean indicating whether the current context is secure (true) or not (false).
WindowOrWorkerGlobalScope.origin Read only
Returns the origin of the global scope, serialized as a string.

Methods

These methods are defined on the WindowOrWorkerGlobalScope mixin, and implemented by Window and WorkerGlobalScope.

WindowOrWorkerGlobalScope.atob()
Decodes a string of data which has been encoded using base-64 encoding.
WindowOrWorkerGlobalScope.btoa()
Creates a base-64 encoded ASCII string from a string of binary data.
WindowOrWorkerGlobalScope.clearInterval()
Cancels the repeated execution set using WindowOrWorkerGlobalScope.setInterval().
WindowOrWorkerGlobalScope.clearTimeout()
Cancels the delayed execution set using WindowOrWorkerGlobalScope.setTimeout().
WindowOrWorkerGlobalScope.createImageBitmap()
Accepts a variety of different image sources, and returns a Promise which resolves to an ImageBitmap. Optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh.
WindowOrWorkerGlobalScope.fetch()
Starts the process of fetching a resource from the network.
WindowOrWorkerGlobalScope.queueMicrotask()
Enqueues a microtask—a short function to be executed after execution of the JavaScript code completes and control isn't being returned to a JavaScript caller, but before handling callbacks and other tasks. This lets your code run without interfering with other, possibly higher priority, code, but before the browser runtime regains control, potentially depending upon the work you need to complete.
WindowOrWorkerGlobalScope.setInterval()
Schedules a function to execute every time a given number of milliseconds elapses.
WindowOrWorkerGlobalScope.setTimeout()
Schedules a function to execute in a given amount of time.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'WindowOrWorkerGlobalScope mixin' in that specification.
Living Standard This is where the main mixin is defined.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
WindowOrWorkerGlobalScopeChrome Full support 4Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support 1.0
atobChrome Full support 4Edge Full support 12Firefox Full support 1
Full support 1
Full support 27
Notes
Notes atob() ignores all space characters in the argument to comply with the latest HTML5 spec (see bug 711180).
Full support 57
Notes
Notes atob() now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 10Opera Full support 10.5Safari Full support 3WebView Android Full support ≤37Chrome Android Full support 18Firefox Android Full support 4
Full support 4
Full support 27
Notes
Notes atob() ignores all space characters in the argument to comply with the latest HTML5 spec (see bug 711180).
Full support 57
Notes
Notes atob() now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 11Safari iOS Full support 1Samsung Internet Android Full support 1.0
btoaChrome Full support 4Edge Full support 12Firefox Full support 1
Full support 1
Full support 52
Notes
Notes btoa() now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 10Opera Full support 10.5Safari Full support 3WebView Android Full support ≤37Chrome Android Full support 18Firefox Android Full support 4
Full support 4
Full support 52
Notes
Notes atob() now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 11Safari iOS Full support 1Samsung Internet Android Full support 1.0
caches
Experimental
Chrome Full support 40Edge Full support ≤79Firefox Full support 42
Full support 42
Full support 52
Notes
Notes caches now defined on WindowOrWorkerGlobalScope mixin.
IE No support NoOpera ? Safari No support NoWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 42
Full support 42
Full support 52
Notes
Notes caches now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
clearIntervalChrome Full support 4Edge Full support 12Firefox Full support 1
Full support 1
Full support 52
Notes
Notes clearInterval() now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 4
Notes
Full support 4
Notes
Notes From Internet Explorer 4 through 8, clearInterval is an Object rather than a Function. This behavior was fixed in Internet Explorer 9.
Opera Full support 4Safari Full support 4WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4
Full support 4
Full support 52
Notes
Notes clearInterval() now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android Full support 1.0
clearTimeoutChrome Full support 45Edge Full support 12Firefox Full support 1
Full support 1
Full support 52
Notes
Notes clearTimeout() now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 4
Notes
Full support 4
Notes
Notes From Internet Explorer 4 through 8, clearTimeout is an Object rather than a Function. This behavior was fixed in Internet Explorer 9.
Opera Full support 4Safari Full support 4WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support 4
Full support 4
Full support 52
Notes
Notes clearTimeout() now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android Full support 5.0
createImageBitmapChrome Full support 50Edge Full support 79Firefox Full support 52
Notes
Full support 52
Notes
Notes createImageBitmap() now defined on WindowOrWorkerGlobalScope mixin.
Full support 42
IE No support NoOpera Full support YesSafari No support NoWebView Android Full support 50Chrome Android Full support 50Firefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support 5.0
crossOriginIsolated
ExperimentalNon-standard
Chrome No support NoEdge No support NoFirefox Full support 72IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
fetch
Experimental
Chrome Full support 42Edge Full support 14Firefox Full support 39
Full support 39
Full support 34
Disabled
Disabled From version 34: this feature is behind the dom.fetch.enable preference. To change preferences in Firefox, visit about:config.
Full support 52
Notes
Notes fetch() now defined on WindowOrWorkerGlobalScope mixin.
IE No support NoOpera Full support 29
Full support 29
Full support 28
Disabled
Disabled From version 28: this feature is behind the Experimental Web Platform Features preference.
Safari Full support 10.1WebView Android Full support 42Chrome Android Full support 42Firefox Android Full support 39
Full support 39
Full support 34
Disabled
Disabled From version 34: this feature is behind the dom.fetch.enable preference. To change preferences in Firefox, visit about:config.
Full support 52
Notes
Notes fetch() now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 29
Full support 29
Full support 28
Disabled
Disabled From version 28: this feature is behind the Experimental Web Platform Features preference.
Safari iOS Full support 10.3Samsung Internet Android Full support 4.0
indexedDBChrome Full support 24Edge Full support 12Firefox Full support 16
Full support 16
Full support 10
Prefixed
Prefixed Implemented with the vendor prefix: moz
Full support 52
Notes
Notes indexedDB now defined on WindowOrWorkerGlobalScope mixin.
IE Partial support 10Opera Full support 15Safari Full support 7WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22
Full support 22
Full support 52
Notes
Notes indexedDB now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android Full support 2.0
isSecureContext
Experimental
Chrome Full support 55Edge Full support ≤79Firefox Full support 52IE ? Opera ? Safari ? WebView Android Full support 55Chrome Android Full support 55Firefox Android Full support 52Opera Android ? Safari iOS ? Samsung Internet Android Full support 6.0
originChrome Full support 59Edge Full support ≤79Firefox Full support 54IE No support NoOpera No support NoSafari No support NoWebView Android Full support 59Chrome Android Full support 59Firefox Android Full support 54Opera Android No support NoSafari iOS No support NoSamsung Internet Android Full support 7.0
queueMicrotaskChrome Full support 71Edge Full support 79Firefox Full support 69IE No support NoOpera Full support 58Safari Full support 12.1WebView Android Full support 71Chrome Android Full support 71Firefox Android No support NoOpera Android Full support 50Safari iOS Full support 12.2Samsung Internet Android Full support 10.0
setIntervalChrome Full support 30Edge Full support 12Firefox Full support 1
Full support 1
Full support 52
Notes
Notes setInterval now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 4Opera Full support 4Safari Full support 1WebView Android Full support 4.4Chrome Android Full support 30Firefox Android Full support 4
Full support 4
Full support 52
Notes
Notes setInterval now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android Full support 3.0
setTimeoutChrome Full support 30Edge Full support 12Firefox Full support 1
Full support 1
Full support 52
Notes
Notes setInterval now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 4Opera Full support 4Safari Full support 1WebView Android Full support 4.4Chrome Android Full support 30Firefox Android Full support 4
Full support 4
Full support 52
Notes
Notes setInterval now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android Full support 3.0

Legend

Full support
Full support
Partial support
Partial support
No support
No support
Compatibility unknown
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also