7
Views
3
Comments
Solved
[InAppBrowser Plugin] trigger inapp browser close action from inside the browser
inappbrowser-plugin
Mobile icon
Forge asset by OutSystems
Application Type
Mobile

Is there a way (without deeplinks) to allow an web app to close In App browser.

So this is the flow.
Mobile app --> opens Web app via in app browser --> has a close button that closes the in-app browser window on the mobile app.

Is this possible? I want a the web app to close the in-app browser window somehow rather than ask the user to click the close button.

2025-01-10 11-40-52
Pedro Gustavo Bilro
Solution

Hey André, like it was said previously, it's not possible to close the IAB directly from the web app that is running inside IAB.

If you're using the latest version of InAppBrowser Plugin, you can try the following:

1. Open the WebApp using OpenInWebView client action. OpenInSystemBrowser I think can work too.

2. In the same screen where you open the IAB, add the InAppBrowserFlow -> InAppBrowserEvents block.

3. Consume the optional OnBrowserPageNavigationCompleted event. There you will receive an event whenever a new page is opened in the web app

4. When you want to close the IAB, navigate to a specific page in the webapp, and then inside the event from the last point, check if the incoming URL (or endpoint) matches that specific page, and if it does, call the Plugin's Close client action to close the IAB.


I haven't tested to see if this works, but I can't see why it wouldn't.

Hope it helps! 

2026-03-20 01-28-51
Saugat Biswas

Hi @André Pinho,

The quick answer is NO.

When you open a Web App inside an In‑App Browser (IAB): 

  • The mobile app owns the browser 
  • The web app runs in a sandbox 
  • For security reasons: 
    • The web page cannot close its parent container 
    • window.close() is blocked 
    • JavaScript cannot control native UI

Cheers,

Saugat

2025-01-10 11-40-52
Pedro Gustavo Bilro
Solution

Hey André, like it was said previously, it's not possible to close the IAB directly from the web app that is running inside IAB.

If you're using the latest version of InAppBrowser Plugin, you can try the following:

1. Open the WebApp using OpenInWebView client action. OpenInSystemBrowser I think can work too.

2. In the same screen where you open the IAB, add the InAppBrowserFlow -> InAppBrowserEvents block.

3. Consume the optional OnBrowserPageNavigationCompleted event. There you will receive an event whenever a new page is opened in the web app

4. When you want to close the IAB, navigate to a specific page in the webapp, and then inside the event from the last point, check if the incoming URL (or endpoint) matches that specific page, and if it does, call the Plugin's Close client action to close the IAB.


I haven't tested to see if this works, but I can't see why it wouldn't.

Hope it helps! 

2018-08-04 18-19-00
André Pinho

Thank you both. We kept the solution asking the user to close to the browser window on a success page. 
Pedro suggestion was good (didn't quite work for me as the app inside the in app browser opened many screens) but the suggestion was useful to trigger additional logic (when the browser was closed) to check that the action that was done on the in app browser was completed, automatically.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.