使用HTML或Javascript从Android WebView打开默认浏览器中的链接

时间:2022-10-22 14:53:35

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?

有没有办法强制Android Webview在默认浏览器中打开网页而不更改Webview - 这意味着代码将位于网页本身?

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.

我的网站需要用户的媒体许可,如果我托管在Webview中(例如通过Facebook移动应用程序),每个应用程序都需要拥有此权限并授予我。

Thanks for the help, Avi.

感谢您的帮助,Avi。

1 个解决方案

#1


0  

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.

不能。通过WebView打开默认浏览器需要在本机App上实现。特别是App开发人员应该重写方法WebViewClient.shouldOverrideUrlLoading并启动一个意图,以通过WebView在单独的浏览器中加载URL。

#1


0  

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.

不能。通过WebView打开默认浏览器需要在本机App上实现。特别是App开发人员应该重写方法WebViewClient.shouldOverrideUrlLoading并启动一个意图,以通过WebView在单独的浏览器中加载URL。