Enabling general JavaScript in WebViewClient

前端 未结 8 729
醉梦人生
醉梦人生 2020-11-29 03:32

While searching for an answer in google, it seems that I\'m not the only one stuck with a problem that seems impossible to solve.

I\'ve managed to create a WebView w

8条回答
  •  广开言路
    2020-11-29 03:43

    The proper way to enable JavaScript is by add the below two lines:

    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    

    Even if after adding its not working then try adding the below line.

    mWebView.getSettings().setDomStorageEnabled(true);
    

    Now It should work. :)

提交回复
热议问题