Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
gedoor committed Jul 18, 2018
1 parent dcd130a commit ad35067
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public void processHTML(String html) {
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setUserAgentString(userAgent);
webView.addJavascriptInterface(new MyJavaScriptInterface(webView), "HTMLOUT");
webView.loadUrl(url);
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished (WebView view, String url){
webView.loadUrl("javascript:window.HTMLOUT.processHTML('<head>'+document.getElementsByTagName('html')[0].innerHTML+'</head>');");
}
});
webView.loadUrl(url);
});
}

Expand Down

0 comments on commit ad35067

Please sign in to comment.