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, thePresentationRequestobject 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 ofpresentationRequestis an a priori unauthenticated URL, then return a Promise rejected with aSecurityErrorand 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
SecurityErrorand abort these steps. - Let
Pbe a new Promise. - Return
Pbut continue running these steps in parallel. - Search the set of controlled presentations for a
PresentationConnectionthat 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 ofpresentationRequestand its presentation identifier is equal topresentationId. - If such a
PresentationConnectionexists, run the following steps:- Let
Sbe thatPresentationConnection. - Resolve
PwithS. - If the presentation connection state of
Sisconnectingorconnected, then abort all remaining steps. - Set the presentation connection state of
Stoconnecting. - Establish a presentation connection with
S. - Abort all remaining steps.
- Let
- Search the set of controlled presentations for the first
PresentationConnectionthat 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
PresentationConnectionexists, letEbe thatPresentationConnection, and run the following steps:- Create a new
PresentationConnectionS. - Set the presentation identifier of
StopresentationId. - Set the presentation URL of
Sto the presentation URL ofE. - Set the presentation connection state of
Stoconnecting. - Add
Sto the set of controlled presentations. - Resolve
PwithS. - Queue a task to fire a trusted event with the name
connectionavailable, that uses thePresentationConnectionAvailableEventinterface with theconnectionattribute 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
Pwith aNotFoundErrorexception.
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.