Embedding a Connect Webview
When you embed a webview inside an iframe, you might want to know when it completes. You can listen to messages dispatched from the iframe to the hosting window for this purpose.
Embedding a Webview in an Iframe
You can use the HTML Iframe to display a connect webview url.
Messages
When a webview is hosted in an iframe, it sends messages to the parent window hosting the iframe using window.parent.postMessage
, a cross-origin communication mechanism available in browsers. You can listen for these messages by registering a listener for message
events on the window
.
Message Body
Here is a sample message sent by the iframe:
Note that at the top level of the message is a single property: the event
object. The properties on this object are described in the Event Properties section.
Event Properties
Property | Type | Description |
---|---|---|
|
| Type of event - either a success or failure |
| string | ID of the webview |
| string | If the event is |
| string | If the event is |
Last updated