【发布时间】:2015-08-31 12:57:40
【问题描述】:
在 webview android 中删除 google drive/doc 查看器中的弹出选项
我需要在webview中查看pdf,用户无法保存irt所以隐藏所有选项
【问题讨论】:
标签: android
在 webview android 中删除 google drive/doc 查看器中的弹出选项
我需要在webview中查看pdf,用户无法保存irt所以隐藏所有选项
【问题讨论】:
标签: android
//initialze WebView
webview = (WebView) findViewById(R.id.fullscree_webview);
//set the javascript enable to your webview
webview.getSettings().setJavaScriptEnabled(true);
//set the WebViewClient
webview.setWebViewClient(new WebViewClient() {
//once the page is loaded get the html element by class or id and through javascript hide it.
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
webview.loadUrl("javascript:(function() { " +
"document.getElementsByClassName('ndfHFb-c4YZDc-GSQQnc-LgbsSe ndfHFb-c4YZDc-to915-LgbsSe VIpgJd-TzA9Ye-eEGnhe ndfHFb-c4YZDc-LgbsSe')[0].style.display='none'; })()");
}
})
【讨论】: