Transferable

Transferable interface represents an object that can be transfered between different execution contexts, like the main thread and Web workers.

This is an abstract interface and there is no object of this type. This interface does not define any method or property; it is merely a tag indicating objects that can be used in specific conditions, such as being transfered to a Worker 使用 Worker.postMessage() 方法。

注意: Transferable interface technically no longer exists. The functionality of Transferable objects still exists, however, but is implemented at a more fundamental level (technically speaking, using the [Transferable] WebIDL extended attribute).

ArrayBuffer , MessagePort , ImageBitmap and OffscreenCanvas types implement this interface.

特性

Transferable interface does not implement or inherit specific properties.

方法

Transferable interface does not implement or inherit specific properties.

规范

规范 状态 Comment
HTML Living Standard
The definition of 'Transferable' in that specification.
实时标准 Replaced Transferable interface with [Transferable] Web IDL extended attribute.
HTML5
The definition of 'Transferable' in that specification.
Recommendation 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
Transferable Chrome Yes Edge 12 Firefox 4 IE 10
注意事项
10
注意事项
Internet Explorer 10 only accepts a single Transferable object as parameter, but not an array.
Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

完整支持
完整支持
见实现注意事项。

另请参阅