reconnect (presentationId) method is called on a PresentationRequest presentationRequest 用户代理 MUST run the following steps to reconnect to a presentation :

输入
presentationRequest PresentationRequest object that reconnect () was called on.
presentationId , a valid presentation identifier
输出
P Promise
  1. Using the document's settings object run the prohibits mixed security contexts algorithm .
  2. If the result of the algorithm is "Prohibits Mixed Security Contexts" presentation request URL of presentationRequest a priori unauthenticated URL , then return a Promise rejected with a SecurityError and abort these steps.
  3. If the document object's active sandboxing flag set 拥有 sandboxed presentation browsing context flag set, then return a Promise rejected with a SecurityError and abort these steps.
  4. Let P be a new Promise .
  5. 返回 P but continue running these steps in parallel.
  6. Search the set of controlled presentations 对于 PresentationConnection that meets the following criteria: its controlling browsing context is the current 浏览上下文 , its presentation connection state 不是 terminated , its presentation URL is equal to one of the presentation request URLs of presentationRequest 及其 presentation identifier 等于 presentationId .
  7. If such a PresentationConnection exists, run the following steps:
    1. Let S be that PresentationConnection .
    2. Resolve P with S .
    3. presentation connection state of S is connecting or connected , then abort all remaining steps.
    4. 设置 presentation connection state of S to connecting .
    5. Establish a presentation connection with S .
    6. Abort all remaining steps.
  8. Search the set of controlled presentations for the first PresentationConnection that meets the following criteria: its presentation connection state 不是 terminated , its presentation URL is equal to one of the presentation request URLs of presentationRequest , and its presentation identifier 等于 presentationId .
  9. If such a PresentationConnection exists, let E be that PresentationConnection , and run the following steps:
    1. 创建新的 PresentationConnection S .
    2. 设置 presentation identifier of S to presentationId .
    3. 设置 presentation URL of S presentation URL of E .
    4. 设置 presentation connection state of S to connecting .
    5. 添加 S set of controlled presentations .
    6. Resolve P with S .
    7. Queue a task to fire a trusted event with the name connectionavailable , that uses the PresentationConnectionAvailableEvent interface with the connection attribute initialized to S , at presentationRequest . The event must not bubble and cancelable and should have no default action.
    8. Establish a presentation connection with S .
    9. Abort all remaining steps.
  10. Reject P 采用 NotFoundError 异常。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
reconnect Chrome 48 Edge ≤79 Firefox 51 IE No Opera 35 Safari ? WebView Android No Chrome Android 48 Firefox Android 51 Opera Android 35 Safari iOS ? Samsung Internet Android 5.0

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

用户必须明确启用此特征。

用户必须明确启用此特征。

元数据

  • 最后修改: