WindowOrWorkerGlobalScope
mixin describes several features common to the
Window
and
WorkerGlobalScope
接口。
Each of these interfaces can, of course, add more features in addition to the ones listed below.
注意
:
WindowOrWorkerGlobalScope
is a mixin and not an interface; you can't actually create an object of type
WindowOrWorkerGlobalScope
.
These properties are defined on the
WindowOrWorkerGlobalScope
混合,和实现通过
Window
and
WorkerGlobalScope
.
WindowOrWorkerGlobalScope.caches
只读
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
只读
SharedArrayBuffer
can be sent via a
Window.postMessage()
调用。
WindowOrWorkerGlobalScope.indexedDB
只读
IDBFactory
对象。
WindowOrWorkerGlobalScope.isSecureContext
只读
true
) 或不 (
false
).
WindowOrWorkerGlobalScope.origin
只读
Returns the origin of the global scope, serialized as a string.
These methods are defined on the
WindowOrWorkerGlobalScope
混合,和实现通过
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()
WindowOrWorkerGlobalScope.setInterval()
.
WindowOrWorkerGlobalScope.clearTimeout()
WindowOrWorkerGlobalScope.setTimeout()
.
WindowOrWorkerGlobalScope.createImageBitmap()
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()
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.
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of '
WindowOrWorkerGlobalScope
mixin' in that specification.
|
实时标准 | This is where the main mixin is defined. |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
WindowOrWorkerGlobalScope
|
Chrome 4 | Edge 12 | Firefox 1 | IE Yes | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android 18 | Firefox Android 4 | Opera Android Yes | Safari iOS Yes | Samsung Internet Android 1.0 |
atob
|
Chrome 4 | Edge 12 |
Firefox
1
|
IE 10 | Opera 10.5 | Safari 3 | WebView Android ≤37 | Chrome Android 18 |
Firefox Android
4
|
Opera Android 11 | Safari iOS 1 | Samsung Internet Android 1.0 |
btoa
|
Chrome 4 | Edge 12 |
Firefox
1
|
IE 10 | Opera 10.5 | Safari 3 | WebView Android ≤37 | Chrome Android 18 |
Firefox Android
4
|
Opera Android 11 | Safari iOS 1 | Samsung Internet Android 1.0 |
caches
|
Chrome 40 | Edge ≤79 |
Firefox
42
|
IE No | Opera ? | Safari No | WebView Android Yes | Chrome Android Yes |
Firefox Android
42
|
Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
clearInterval
|
Chrome 4 | Edge 12 |
Firefox
1
|
IE
4
|
Opera 4 | Safari 4 | WebView Android 1 | Chrome Android 18 |
Firefox Android
4
|
Opera Android 10.1 | Safari iOS 1 | Samsung Internet Android 1.0 |
clearTimeout
|
Chrome 45 | Edge 12 |
Firefox
1
|
IE
4
|
Opera 4 | Safari 4 | WebView Android 45 | Chrome Android 45 |
Firefox Android
4
|
Opera Android 10.1 | Safari iOS 1 | Samsung Internet Android 5.0 |
createImageBitmap
|
Chrome 50 | Edge 79 |
Firefox
52
|
IE No | Opera Yes | Safari No | WebView Android 50 | Chrome Android 50 | Firefox Android Yes | Opera Android Yes | Safari iOS ? | Samsung Internet Android 5.0 |
crossOriginIsolated
非标
|
Chrome No | Edge No | Firefox 72 | IE No | Opera No | Safari No | WebView Android No | Chrome Android No | Firefox Android No | Opera Android No | Safari iOS No | Samsung Internet Android No |
fetch
|
Chrome 42 | Edge 14 |
Firefox
39
|
IE No |
Opera
29
|
Safari 10.1 | WebView Android 42 | Chrome Android 42 |
Firefox Android
39
|
Opera Android
29
|
Safari iOS 10.3 | Samsung Internet Android 4.0 |
indexedDB
|
Chrome 24 | Edge 12 |
Firefox
16
|
IE 部分支持 10 | Opera 15 | Safari 7 | WebView Android Yes | Chrome Android 25 |
Firefox Android
22
|
Opera Android 14 | Safari iOS 8 | Samsung Internet Android 2.0 |
isSecureContext
|
Chrome 55 | Edge ≤79 | Firefox 52 | IE ? | Opera ? | Safari ? | WebView Android 55 | Chrome Android 55 | Firefox Android 52 | Opera Android ? | Safari iOS ? | Samsung Internet Android 6.0 |
origin
|
Chrome 59 | Edge ≤79 | Firefox 54 | IE No | Opera No | Safari No | WebView Android 59 | Chrome Android 59 | Firefox Android 54 | Opera Android No | Safari iOS No | Samsung Internet Android 7.0 |
queueMicrotask
|
Chrome 71 | Edge 79 | Firefox 69 | IE No | Opera 58 | Safari 12.1 | WebView Android 71 | Chrome Android 71 | Firefox Android No | Opera Android 50 | Safari iOS 12.2 | Samsung Internet Android 10.0 |
setInterval
|
Chrome 30 | Edge 12 |
Firefox
1
|
IE 4 | Opera 4 | Safari 1 | WebView Android 4.4 | Chrome Android 30 |
Firefox Android
4
|
Opera Android 10.1 | Safari iOS 1 | Samsung Internet Android 3.0 |
setTimeout
|
Chrome 30 | Edge 12 |
Firefox
1
|
IE 4 | Opera 4 | Safari 1 | WebView Android 4.4 | Chrome Android 30 |
Firefox Android
4
|
Opera Android 10.1 | Safari iOS 1 | Samsung Internet Android 3.0 |
完整支持
部分支持
不支持
兼容性未知
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
见实现注意事项。
用户必须明确启用此特征。
要求使用供应商前缀或不同名称。