getAvailability () method is called, the user agent MUST run the following steps:

输入
presentationUrls , a list of presentation request URLs
输出
P Promise
  1. If one of the following conditions is true: Run the following substeps:
    1. 返回 Promise rejected with a SecurityError .
    2. Abort these steps.
  2. Let P be a new Promise .
  3. 返回 P , but continue running these steps in parallel .
  4. If the user agent is unable to monitor the list of available presentation displays for the entire duration of the controlling browsing context (e.g., because the user has disabled this feature), then:
    1. Resolve P with a new PresentationAvailability object with its value 特性被设为 false .
    2. Abort all the remaining steps.
  5. If the user agent is unable to continuously monitor the list of available presentation displays but can find presentation displays in order to start a connection, then:
    1. Reject P 采用 NotSupportedError 异常。
    2. Abort all the remaining steps.
  6. If there exists a tuple ( A , presentationUrls ) set of availability objects , then:
    1. Resolve P with A .
    2. Abort all the remaining steps.
  7. Let A be a new PresentationAvailability object with its value property set as follows:
    1. false list of available presentation displays is empty.
    2. true if there is at least one compatible presentation display for some member of presentationUrls . Meaning there is an entry (presentationUrl, display) list of available presentation displays for some presentationUrl in presentationUrls .
    3. false 否则。
  8. Create a tuple ( A , presentationUrls ) and add it to the set of availability objects .
  9. Run the algorithm to monitor the list of available presentation displays .
  10. Resolve P with A .

浏览器兼容性

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
getAvailability 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

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

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

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

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

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

元数据

  • 最后修改: