Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open link in default browser from Android WebView with HTML or Javascript only

Is there a way to force Android Webview to open a web page in the default browser with no changes to the Webview - meaning the code will be located in the web page itself?

My website needs media permission from the user, and if I'm hosted in a Webview (via Facebook mobile application for example), each application needs to have this permission and grant it to me.

Thanks for the help, Avi.

like image 487
Avi Ankona Avatar asked Oct 20 '25 10:10

Avi Ankona


1 Answers

No. Opening default browser by WebView requires an implementation on native App. In particular the App developer should override the method WebViewClient.shouldOverrideUrlLoading and launch an intent to load the url in a separate browser instead through the WebView.

like image 123
Pollizzio Avatar answered Oct 21 '25 22:10

Pollizzio



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!