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

@capacitor/browser Check if there is a browser open before calling close() #1899

Closed
aleksandar-brkic opened this issue Nov 14, 2023 · 3 comments

Comments

@aleksandar-brkic
Copy link

Feature Request

Plugin

@capacitor/browser

Description

When calling the close() method while there is no capacitor browser window open, the console logs an error saying No active window to close! . When you open a deeplink from the capacitor browser itself, on some devices (particularly iOS) the browser does not close, as that link is already opened in the background (some url in the app page that actually started the capacitor browser). So we added that method on the deeplink open listener, but this then fires on every deeplink, not just that scenario, which causes the error (which does not affect the user or the code, just annoying in the logs).

Preferred Solution

It would be good if we had a method to check if the browser is open already. Eg if(Browser.isOpen()) Browser.close() which would stop the close method being called when not needed.

@Ionitron
Copy link
Collaborator

This issue needs more information before it can be addressed.
In particular, the reporter needs to provide a minimal sample app that demonstrates the issue.
If no sample app is provided within 15 days, the issue will be closed.

Please see the Contributing Guide for how to create a Sample App.

Thanks!
Ionitron 💙

@Ionitron
Copy link
Collaborator

It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot.

Have a great day!
Ionitron 💙

Copy link

ionitron-bot bot commented Dec 15, 2023

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants