Close all webviews

You can close all webviews using window.igWebview.close(). This closes all open webviews, regardless of the channel used to open the webview.

When you create a new webview, the webview template includes a <script> block at the top of the <body> that contains {{ig_webview_sdk}}. Add your close-webview script content beneath the {{ig_webview_sdk}} line to use the window.igWebview.close() function.

<script>
{{ig_webview_sdk}}
//Script logic to determine when to close the webview
window.igWebview.close()
</script>

You can see this function in action in the example webview provided when you create a new webview.

If you don't want to use this function, you must use a channel-specific function to close the webview.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.