gpt4 book ai didi

android - 在 webview android 中删除谷歌驱动器/文档查看器中的弹出选项

转载 作者:行者123 更新时间:2023-11-29 14:14:04 24 4
gpt4 key购买 nike

删除 webview android 中的 google drive/doc viewer 中的弹出选项

我需要在 webview 中查看 pdf,用户无法保存 irt 所以隐藏所有选项

最佳答案

//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'; })()");
}
})

关于android - 在 webview android 中删除谷歌驱动器/文档查看器中的弹出选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32311851/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com