ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.89k stars 995 forks source link

feat: Open Main Browser instead of WebView #4624

Closed sanderschnydrig closed 3 years ago

sanderschnydrig commented 3 years ago

Feature Request

Capacitor Doctor

Latest Dependencies:

  @capacitor/cli: 3.0.0
  @capacitor/core: 3.0.0
  @capacitor/android: 3.0.0
  @capacitor/ios: 3.0.0

Installed Dependencies:

  @capacitor/cli: 3.0.0
  @capacitor/core: 3.0.0
  @capacitor/android: 3.0.0
  @capacitor/ios: 3.0.0

[success] Android looking great! 👌
[error] Xcode is not installed

Description

Since updating from Capacitor v2.4.7 to v3.0.0 the Browser Plugin opens links in a WebView instead of the main Browser like before. This breaks my functionality of opening the website in a Browser and using deeplinks to return back to the App, because WebView treats all links as if they should be opened in the WebView itself.

Platform(s)

Android and iOS

Preferred Solution

Make it possible to use a flag when using the Browser Plugin to specify if the WebView should be opened or like in Version 2.4.7 the main browser should be used.

Alternatives

I didn't find an alternative to this, I consider this functionality to be standard and the change a breaking change.

Additional Context

Reproduction can be found in this repository: https://github.com/sanderschnydrig/capacitorFeatureRequestBrowser

Ionitron commented 3 years ago

This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.

Please see the Contributing Guide for how to create a Code Reproduction.

Thanks! Ionitron 💙

sanderschnydrig commented 3 years ago

Sure. Here you go!

https://github.com/sanderschnydrig/capacitorFeatureRequestBrowser

As you can see it immediately opens https://capacitorjs.com in webview inapp browser instead of my main Browser (which was the case in version 2.4.7 where my functionality is still working fine) which in my Android emulator is Chrome. WebView doesn't support Deep Links and I need this so I can update to v3.0.0.

jcesarmobile commented 3 years ago

Browser plugin is supposed to open the url you pass in an "In App" Browser, it's always been like that, if if was opening Safari/Chrome for you, you were probably using the web version that uses window.open instead of the native code.

If you want to open Safari/Chrome you can use window.open, or you can use app-launcher's plugin openUrl method

sanderschnydrig commented 3 years ago

@jcesarmobile window.open worked for opening the main browser, thanks!

ionitron-bot[bot] commented 1 year ago

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 Capacitor, please create a new issue and ensure the template is fully filled out.