4

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.

Avi Ankona
  • 93
  • 2
  • 8

1 Answers1

2

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.

Pollizzio
  • 1,023
  • 8
  • 11
  • That's not what I was asking about. As I need the media permission, I want to ask it by myself and not to have each application I'm included in to ask it for me. the most simple way to do it (that I can think of - please share if you think on additional) is to open the link in the default browser and ask the user to approve it with the browser standard dialog. – Avi Ankona Jul 23 '15 at 06:10
  • Sorry, please clarify the following: are you the developer of these applications or you have not any control? For "media permission" you mean the android App's manifest media permission? – Pollizzio Jul 23 '15 at 07:00
  • 1
    I'm not related to the applications. I'm a website developer that offer the users to use their camera in the site and when I'm hosted in a webview I'm not permitted to use the camera unless the application owner (Facebook for example) give me explicit access. So if a mobile application shows my website in a webview, I want to open it in the default browser instead. – Avi Ankona Jul 23 '15 at 10:22