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

InAppBrowser.isOpened does not seem reliable #105

Closed
peter-meemo opened this issue May 29, 2019 · 4 comments
Closed

InAppBrowser.isOpened does not seem reliable #105

peter-meemo opened this issue May 29, 2019 · 4 comments

Comments

@peter-meemo
Copy link

Am I misunderstanding how this is supposed to work?

final iab = InAppBrowser();

Future<void> main async {
  await iab.open('https://www.google.com');
  assert(iab.isOpened());
  // ...
}

This assert will usually, but not always, fail, but a native browser to the specified website is opened. Is this expected?

@peter-meemo
Copy link
Author

(This is on Android simulator)

@peter-meemo
Copy link
Author

It appears that for InAppBrowser, _isOpened is only set to true when a onBrowserCreated event is received; the browser never receives that event in the above code. I notice that for ChromeSafariBrowser, _isOpened is set to true at the end of the open() method; is this discrepancy intended?

@peter-meemo
Copy link
Author

I think I see the underlying issue; I'm expecting the future of open() to resolve once the site is loaded, but it resolves as soon as the site starts opening, which is before onCreated is even called.

This was referenced Jul 6, 2020
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant