Questa traduzione è incompleta. Collabora alla traduzione di questo articolo dall’originale in lingua inglese.

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.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.
Fetch
The definition of 'fetch()' in that specification.
Living Standard Definition of the fetch() method.
Service Workers
The definition of 'caches' in that specification.
Working Draft Definition of the caches property.
Indexed Database API 2.0
The definition of 'indexedDB' in that specification.
Recommendation Definition of the indexedDB property.
Secure Contexts
The definition of 'isSecureContext' in that specification.
Candidate Recommendation Definition of the isSecureContext property.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 54Edge ? Firefox Full support 52IE ? Opera ? Safari ? WebView Android ? Chrome Android Full support 54Edge Mobile ? Firefox Android Full support 52Opera Android ? Safari 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 YesEdge Mobile ? Firefox 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 YesEdge Mobile ? Firefox 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 YesEdge Mobile ? Firefox 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 1Edge 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 18Edge Mobile Full support YesFirefox Android Full support 4
Full support 4
Full support 52
Notes
Notes clearInterval() now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 6Safari iOS Full support 1Samsung Internet Android ?
clearTimeoutChrome Full support 1Edge 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 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4
Full support 4
Full support 52
Notes
Notes clearTimeout() now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 6Safari iOS Full support 1Samsung Internet Android ?
createImageBitmapChrome Full support 50Edge No support NoFirefox Full support 42
Full support 42
Full support 52
Notes
Notes createImageBitmap() now defined on WindowOrWorkerGlobalScope mixin.
IE No support NoOpera Full support YesSafari No support NoWebView Android Full support 50Chrome Android Full support 50Edge Mobile ? Firefox Android ? Opera 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 10WebView Android Full support 42Chrome Android Full support 42Edge Mobile Full support 14Firefox 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 ? Safari iOS Full support 10Samsung Internet Android ?
indexedDBChrome Full support 24
Full support 24
Full support 23
Prefixed
Prefixed Requires the vendor prefix: webkit
Edge Full support YesFirefox Full support 16
Full support 16
Full support 10
Prefixed
Prefixed Requires 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 ? Edge Mobile Full support YesFirefox Android Full support 22
Full support 22
Full support 52
Notes
Notes indexedDB now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 22Safari 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 55Edge Mobile ? Firefox 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 59Edge Mobile ? Firefox Android Full support 54Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
setIntervalChrome Full support 1Edge 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 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4
Full support 4
Full support 52
Notes
Notes setInterval now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 6Safari iOS Full support 1Samsung Internet Android ?
setTimeoutChrome Full support 1Edge 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 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4
Full support 4
Full support 52
Notes
Notes setInterval now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 6Safari 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

Tag del documento e collaboratori

Hanno collaborato alla realizzazione di questa pagina: fscholz
Ultima modifica di: fscholz,