Help us test MDN's new front-end: https://discourse.mozilla.org/t/help-us-test-mdns-new-react-front-end-beta/42593

Our volunteers haven't translated this article into Türkçe yet. Join us and help get the job done!
You can also read the article in English (US).

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.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 properties 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()
Queues a microtask.
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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
WindowOrWorkerGlobalScopeChrome Full support 4Edge ? Firefox Full support 1IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS ? Samsung Internet Android ?
atobChrome Full support YesEdge Full support YesFirefox 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 YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox 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 ? Safari iOS Full support YesSamsung Internet Android ?
btoaChrome Full support YesEdge Full support YesFirefox Full support 1
Full support 1
Full support 52
Notes
Notes btoa() now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 10Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4
Full support 4
Full support 52
Notes
Notes atob() now defined on WindowOrWorkerGlobalScope mixin.
Opera Android ? Safari iOS Full support YesSamsung Internet Android ?
caches
Experimental
Chrome Full support 40Edge ? Firefox 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 ?
clearIntervalChrome Full support 4Edge Full support YesFirefox Full support 1
Full support 1
Full support 52
Notes
Notes clearInterval() now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 4Opera 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 ?
clearTimeoutChrome Full support 45Edge Full support YesFirefox Full support 1
Full support 1
Full support 52
Notes
Notes clearTimeout() now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 4Opera 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 ?
createImageBitmapChrome Full support 50Edge No support NoFirefox 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 ?
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 ?
indexedDBChrome Full support 24Edge Full support YesFirefox 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 ? Firefox 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 ?
isSecureContext
Experimental
Chrome Full support 55Edge ? Firefox Full support 52IE ? Opera ? Safari ? WebView Android Full support 55Chrome Android Full support 55Firefox Android Full support 52Opera Android ? Safari iOS ? Samsung Internet Android ?
originChrome Full support 59Edge ? Firefox 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 ?
setIntervalChrome Full support 30Edge Full support YesFirefox 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 YesChrome 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 ?
setTimeoutChrome Full support 30Edge Full support YesFirefox 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 YesChrome 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 ?

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.
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

Document Tags and Contributors

Last updated by: zbjornson,