WebView blocking pop up windows?

前端 未结 2 1940
太阳男子
太阳男子 2021-01-03 09:41

I\'m using WebView to browse pesopay.com and it works properly, except when I pressed the submit button. Using internet browsers like Google Chrome will show a

2条回答
  •  迷失自我
    2021-01-03 10:27

    If i am getting right , you need to use JavaScriptInterface for calling JavaScript function from Android.

    Check this link which may help you :

    http://www.codeproject.com/Articles/392603/Android-addJavaScriptInterface

    Or check some websettings : http://developer.android.com/reference/android/webkit/WebSettings.html#setSupportMultipleWindows%28boolean

    try to put this code in onCreate()

            webView.getSettings().setPluginsEnabled(true);
            webView.getSettings().setAllowFileAccess(true);
            webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    

提交回复
热议问题