getAvailability - Web APIs 编辑
When the getAvailability()
method is called, the user agent MUST run the following steps:
- Input
- presentationUrls, a list of presentation request URLs
- Output
- P, a Promise
- If one of the following conditions is true:
- The result of running the prohibits mixed security contexts algorithm on the document's settings object is
"Prohibits Mixed Security Contexts"
and presentationUrl is an a priori unauthenticated URL. - The document object's active sandboxing flag set has the sandboxed presentation browsing context flag set.
- Return a Promise rejected with a
SecurityError
. - Abort these steps.
- The result of running the prohibits mixed security contexts algorithm on the document's settings object is
- Let P be a new Promise.
- Return P, but continue running these steps in parallel.
- 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:
- Resolve P with a new
PresentationAvailability
object with itsvalue
property set tofalse
. - Abort all the remaining steps.
- Resolve P with a new
- 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:
- Reject P with a
NotSupportedError
exception. - Abort all the remaining steps.
- Reject P with a
- If there exists a tuple (A, presentationUrls) in the set of availability objects, then:
- Resolve P with A.
- Abort all the remaining steps.
- Let A be a new
PresentationAvailability
object with itsvalue
property set as follows:false
if the list of available presentation displays is empty.true
if there is at least one compatible presentation display for some member of presentationUrls. Meaning there is an entry (presentationUrl, display) in the list of available presentation displays for some presentationUrl in presentationUrls.false
otherwise.
- Create a tuple (A, presentationUrls) and add it to the set of availability objects.
- Run the algorithm to monitor the list of available presentation displays.
- Resolve P with A.
Browser compatibility
BCD tables only load in the browser
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论