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 aWindow.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 anImageBitmap
. Optionally the source is cropped to the rectangle of pixels originating at (sx
,sy
) with widthsw
, and heightsh
. 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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
WindowOrWorkerGlobalScope | Chrome Full support 4 | Edge Full support 12 | Firefox Full support 1 | IE Full support Yes | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support 1.0 |
atob | Chrome Full support 4 | Edge Full support 12 | Firefox
Full support
1
| IE Full support 10 | Opera Full support 10.5 | Safari Full support 3 | WebView Android Full support ≤37 | Chrome Android Full support 18 | Firefox Android
Full support
4
| Opera Android Full support 11 | Safari iOS Full support 1 | Samsung Internet Android Full support 1.0 |
btoa | Chrome Full support 4 | Edge Full support 12 | Firefox
Full support
1
| IE Full support 10 | Opera Full support 10.5 | Safari Full support 3 | WebView Android Full support ≤37 | Chrome Android Full support 18 | Firefox Android
Full support
4
| Opera Android Full support 11 | Safari iOS Full support 1 | Samsung Internet Android Full support 1.0 |
caches | Chrome Full support 40 | Edge Full support ≤79 | Firefox
Full support
42
| IE No support No | Opera ? | Safari No support No | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android
Full support
42
| Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
clearInterval | Chrome Full support 4 | Edge Full support 12 | Firefox
Full support
1
| IE
Full support
4
| Opera Full support 4 | Safari Full support 4 | WebView Android Full support 1 | Chrome Android Full support 18 | Firefox Android
Full support
4
| Opera Android Full support 10.1 | Safari iOS Full support 1 | Samsung Internet Android Full support 1.0 |
clearTimeout | Chrome Full support 45 | Edge Full support 12 | Firefox
Full support
1
| IE
Full support
4
| Opera Full support 4 | Safari Full support 4 | WebView Android Full support 45 | Chrome Android Full support 45 | Firefox Android
Full support
4
| Opera Android Full support 10.1 | Safari iOS Full support 1 | Samsung Internet Android Full support 5.0 |
createImageBitmap | Chrome Full support 50 | Edge Full support 79 | Firefox
Full support
52
| IE No support No | Opera Full support Yes | Safari No support No | WebView Android Full support 50 | Chrome Android Full support 50 | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support 5.0 |
crossOriginIsolated | Chrome No support No | Edge No support No | Firefox Full support 72 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android No support No | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
fetch | Chrome Full support 42 | Edge Full support 14 | Firefox
Full support
39
| IE No support No | Opera
Full support
29
| Safari Full support 10.1 | WebView Android Full support 42 | Chrome Android Full support 42 | Firefox Android
Full support
39
| Opera Android
Full support
29
| Safari iOS Full support 10.3 | Samsung Internet Android Full support 4.0 |
indexedDB | Chrome Full support 24 | Edge Full support 12 | Firefox
Full support
16
| IE Partial support 10 | Opera Full support 15 | Safari Full support 7 | WebView Android Full support Yes | Chrome Android Full support 25 | Firefox Android
Full support
22
| Opera Android Full support 14 | Safari iOS Full support 8 | Samsung Internet Android Full support 2.0 |
isSecureContext | Chrome Full support 55 | Edge Full support ≤79 | Firefox Full support 52 | IE ? | Opera ? | Safari ? | WebView Android Full support 55 | Chrome Android Full support 55 | Firefox Android Full support 52 | Opera Android ? | Safari iOS ? | Samsung Internet Android Full support 6.0 |
origin | Chrome Full support 59 | Edge Full support ≤79 | Firefox Full support 54 | IE No support No | Opera No support No | Safari No support No | WebView Android Full support 59 | Chrome Android Full support 59 | Firefox Android Full support 54 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android Full support 7.0 |
queueMicrotask | Chrome Full support 71 | Edge Full support 79 | Firefox Full support 69 | IE No support No | Opera Full support 58 | Safari Full support 12.1 | WebView Android Full support 71 | Chrome Android Full support 71 | Firefox Android No support No | Opera Android Full support 50 | Safari iOS Full support 12.2 | Samsung Internet Android Full support 10.0 |
setInterval | Chrome Full support 30 | Edge Full support 12 | Firefox
Full support
1
| IE Full support 4 | Opera Full support 4 | Safari Full support 1 | WebView Android Full support 4.4 | Chrome Android Full support 30 | Firefox Android
Full support
4
| Opera Android Full support 10.1 | Safari iOS Full support 1 | Samsung Internet Android Full support 3.0 |
setTimeout | Chrome Full support 30 | Edge Full support 12 | Firefox
Full support
1
| IE Full support 4 | Opera Full support 4 | Safari Full support 1 | WebView Android Full support 4.4 | Chrome Android Full support 30 | Firefox Android
Full support
4
| Opera Android Full support 10.1 | Safari iOS Full support 1 | Samsung 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.