We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Cette traduction est incomplète. Aidez à traduire cet article depuis l'anglais.

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 Lecture seule
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 Lecture seule
Provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an IDBFactory object.
WindowOrWorkerGlobalScope.isSecureContext Lecture seule
Returns a boolean indicating whether the current context is secure (true) or not (false).
WindowOrWorkerGlobalScope.origin Lecture seule
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
La définition de 'WindowOrWorkerGlobalScope mixin' dans cette spécification.
Standard évolutif This is where the main mixin is defined.
Fetch
La définition de 'fetch()' dans cette spécification.
Standard évolutif Definition of the fetch() method.
Service Workers
La définition de 'caches' dans cette spécification.
Version de travail Definition of the caches property.
Indexed Database API 2.0
La définition de 'indexedDB' dans cette spécification.
Recommendation Definition of the indexedDB property.
Secure Contexts
La définition de 'isSecureContext' dans cette spécification.
Candidat au statut de recommandation Definition of the isSecureContext property.

Browser compatibility

Nous convertissons les données de compatibilité dans un format JSON. Ce tableau de compatibilité utilise encore l'ancien format car nous n'avons pas encore converti les données qu'il contient. Vous pouvez nous aider en contribuant !

Feature Firefox (Gecko) Chrome Edge Internet Explorer Opera Safari
Basic support 52 (52) 54 ? ? ? ?
origin 54 (54) 59 ? ? ? ?
Feature Android Webview Edge Firefox Mobile (Gecko) Android IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ? ? 52.0 (52) ? ? ? ? 54
origin ? ? 54.0 (54) ? ? ? ? 59

 

See also

Étiquettes et contributeurs liés au document

Contributeurs à cette page : Bzbarsky
Dernière mise à jour par : Bzbarsky,