0

I struggled with how to name this one, but basically I have a WebView that allows users to statically specify a URL and then display the page in side our app in a WebView. All fine and dandy - it works. However one user has specified www.streamable.com which allows a user to upload a video, and then provides a URL to that video.

The WebView loads the www.streamable.com site just fine, but does not seem to do anything when they hit the "Upload a video file" button. In a normal browser the following is displayed (even on a mobile device):

enter image description here

and the normal popup (after you choose which mechanism):

enter image description here

I visited the following StackOverflow examples, but they haven't worked:

WebView blocking pop up windows?

How to display javascript popup in android webview

How to work with pop ups window in android webview

Is this some Javascript restriction (tried those options), or a known security restriction that the WebView enforces that I haven't stumbled across?

Here is the code that I am using:

            mWebView.setWebChromeClient(new WebChromeClient() {
            }); 
            mWebView.setWebViewClient(new WebViewClient() {
             @Override
             public boolean shouldOverrideUrlLoading (WebView view, String url) {
                 view.loadUrl(url);
                 return true;
             }
            }); 
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setAppCacheEnabled(true);
            mWebView.loadUrl("www.streamable.com");

Thanks in advance for your help.

Stephen McCormick
  • 1,706
  • 22
  • 38

1 Answers1

0

This do not answer directly your question but could help. Sometime ago I was having a similar issue with one specific web page (That page was not under my control), It was working on web, even with mobile browser but not with WebView, I tried different ways to make it work and I could not make it, for me one of the reason was because of the permissions to open the camera (you can check if you are using android Lollipop or more recent). But at the end the best solution that I found, and what I use instead of webview is

Chrome Custom Tabs

You can check the the implementation here Chrome Custom Tabs .

As they mention :

The WebView is good solution if you are hosting your own content inside your app. If your app directs people to URLs outside your domain, we recommend that you use Chrome Custom Tabs

You can check all the detailed reasons in the link provided before.

Since you are accessing 3rd party web pages I think this is the way to go, and for sure the www.streamable.com site will work.

alan10fm
  • 239
  • 2
  • 6