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"
andpresentationUrl
is an a priori unauthenticated URL. - The document object's active sandboxing flag set has the sandboxed presentation browsing context flag set.
Run the following substeps:
- 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 newPresentationAvailability
object with itsvalue
property set tofalse
. - Abort all the remaining steps.
- Resolve
- 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 aNotSupportedError
exception. - Abort all the remaining steps.
- Reject
- If there exists a tuple (
A
,presentationUrls
) in the set of availability objects, then:- Resolve
P
withA
. - Abort all the remaining steps.
- Resolve
- Let
A
be a newPresentationAvailability
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 ofpresentationUrls
. Meaning there is an entry(presentationUrl, display)
in the list of available presentation displays for somepresentationUrl
inpresentationUrls
.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
withA
.
Browser compatibility
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.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
Full support 48 |
Edge
Full support ≤79 |
Firefox Full support 51 Full support 51 Disabled' From version 51: this feature is behind the |
IE
No support No |
Opera
Full support 35 |
Safari
? |
WebView Android
No support No |
Chrome Android
Full support 48 |
Firefox Android Full support 51 Full support 51 Disabled' From version 51: this feature is behind the |
Opera Android
Full support 35 |
Safari iOS
? |
Samsung Internet Android
Full support 5.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
- User must explicitly enable this feature.'
- User must explicitly enable this feature.
getAvailability by Mozilla Contributors is licensed under CC-BY-SA 2.5.