PresentationConnection

可用性有限

此特性不是基线特性,因为它在一些最广泛使用的浏览器中不起作用。

实验性: 这是一项实验性技术
在生产中使用此技术之前,请仔细检查浏览器兼容性表格

安全上下文: 此功能仅在安全上下文(HTTPS)中可用,且支持此功能的浏览器数量有限。

PresentationConnection 接口是 Presentation API 的一部分,提供了管理单个演示文稿的方法和属性。每个 演示连接 都由一个 PresentationConnection 对象表示。控制用户代理(controlling user agent)和接收用户代理(receiving user agent)都必须实现 PresentationConnection

EventTarget PresentationConnection

实例属性

PresentationConnection.binaryType 实验性

返回 blob 或 arrayBuffer。当创建一个 PresentationConnection 对象时,其 binaryType IDL 属性必须设置为字符串 "arraybuffer"

PresentationConnection.id 只读 实验性

提供演示连接标识符。

PresentationConnection.state 只读 实验性

返回演示连接的当前状态。

PresentationConnection.url 只读 实验性

返回用于创建或重新连接到演示文稿的 URL。

实例方法

PresentationConnection.close() 实验性

关闭当前连接并向 close 事件发送一个 PresentationConnectionCloseEvent

PresentationConnection.send() 实验性

在控制浏览上下文和呈现浏览上下文之间发送二进制或文本数据。

PresentationConnection.terminate() 实验性

终止当前连接并触发 terminate 事件。

事件

close 实验性

在调用 PresentationConnection.close() 时触发。

connect 实验性

在建立演示连接时触发。

message 实验性

在调用 PresentationConnection.send() 时触发。

terminate 实验性

在调用 PresentationConnection.terminate() 时触发。

规范

规范
Presentation API
# interface-presentationconnection

浏览器兼容性