When the reconnect(presentationId)
method is called on a PresentationRequest
presentationRequest
, the user agent MUST run the following steps to reconnect to a presentation:
- Input
presentationRequest
, thePresentationRequest
object thatreconnect
() was called on.presentationId
, a valid presentation identifier- Output
P
, a Promise
- Using the document's settings object run the prohibits mixed security contexts algorithm.
- If the result of the algorithm is
"Prohibits Mixed Security Contexts"
and the presentation request URL ofpresentationRequest
is an a priori unauthenticated URL, then return a Promise rejected with aSecurityError
and abort these steps. - If the document object's active sandboxing flag set has the sandboxed presentation browsing context flag set, then return a Promise rejected with a
SecurityError
and abort these steps. - Let
P
be a new Promise. - Return
P
but continue running these steps in parallel. - Search the set of controlled presentations for a
PresentationConnection
that meets the following criteria: its controlling browsing context is the current browsing context, its presentation connection state is notterminated
, its presentation URL is equal to one of the presentation request URLs ofpresentationRequest
and its presentation identifier is equal topresentationId
. - If such a
PresentationConnection
exists, run the following steps:- Let
S
be thatPresentationConnection
. - Resolve
P
withS
. - If the presentation connection state of
S
isconnecting
orconnected
, then abort all remaining steps. - Set the presentation connection state of
S
toconnecting
. - Establish a presentation connection with
S
. - Abort all remaining steps.
- Let
- Search the set of controlled presentations for the first
PresentationConnection
that meets the following criteria: its presentation connection state is notterminated
, its presentation URL is equal to one of the presentation request URLs ofpresentationRequest
, and its presentation identifier is equal topresentationId
. - If such a
PresentationConnection
exists, letE
be thatPresentationConnection
, and run the following steps:- Create a new
PresentationConnection
S
. - Set the presentation identifier of
S
topresentationId
. - Set the presentation URL of
S
to the presentation URL ofE
. - Set the presentation connection state of
S
toconnecting
. - Add
S
to the set of controlled presentations. - Resolve
P
withS
. - Queue a task to fire a trusted event with the name
connectionavailable
, that uses thePresentationConnectionAvailableEvent
interface with theconnection
attribute initialized toS
, atpresentationRequest
. The event must not bubble and cancelable and should have no default action. - Establish a presentation connection with
S
. - Abort all remaining steps.
- Create a new
- Reject
P
with aNotFoundError
exception.
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.
reconnect by Mozilla Contributors is licensed under CC-BY-SA 2.5.