Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Window Support #937

Open
Lindsor opened this issue Mar 15, 2022 · 3 comments
Open

Multiple Window Support #937

Lindsor opened this issue Mar 15, 2022 · 3 comments

Comments

@Lindsor
Copy link

Lindsor commented Mar 15, 2022

Feature Request

Feature Description

We use InAppBrowser as an SSO solution for our application, this has worked for the last 6 or so years. Now we have a new vendor who needs to be able to open a "New tab" with shared cookies/session. This means we cannot trigger an opening of the user device browser it would have to be another shared instance of InAppBrowser.
Currently the vendor opens new tabs through window.open(<target url>, '_blank'); which works in the web version of our SSO. But when it's loaded through InAppBrowser it just replaces the entire page with the <target url>.

Are there any plans to support multiple InAppBrowser windows?
And/Or
Are there any viable workarounds, i see in the *.java code there is a comment saying its not supported but no reason given.

Thanks

@breautek
Copy link
Contributor

In the current major release, window.open is no longer the in app browser (that is the in app browser plugin no longer overwrites window.open). Instead, the plugin API is cordova.InAppBrowser.open. The plugin API is still a drop-in replacement so you can still overwrite window.open yourself if you like.

In app browser isn't something that I use, but I was always under the impression that multiple windows were supported because cordova.InAppBrowser.open returns a reference. Are you sure you're calling on the actual in app browser API instead of the browser's window.open API?

@Lindsor
Copy link
Author

Lindsor commented Mar 15, 2022

@breautek you are correct in pretty much everything. The only thing is that my usecase is calling window.open on the page INSIDE the browser.

window.InAppBrowser.open exists in the hybrid applicaiton.

@breautek
Copy link
Contributor

Ah gotcha, you want to be able to open a new window from within the IAB window. I guess that's tricky as the main goal of the IAB browser is to be able to load in potentially untrusted remote content without exposing the cordova bridge.

Are there any plans to support multiple InAppBrowser windows?

Apache projects is all volunteer driven. Afaik, there isn't anyone building or looking into this kind of feature. But a PR is always welcome.

I'd support any PR that adds the feature without exposing the cordova bridge. The open API should probably behave similar to an actual browser. To do that, the chrome client has a onCreateWindow hook, so I think

public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
would be a starting place. I'm not really an expert in this area, so I'm not sure what is needed to make this work as expected.

If you're willing to tackle this, you can always use our Dev Mailing List to discuss the development of this feature as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants