gpt4 book ai didi

android - 如何从 webview 中删除类

转载 作者:搜寻专家 更新时间:2023-11-01 08:44:19 25 4
gpt4 key购买 nike

我正在尝试删除这个 div:

<div data-role="navbar" data-iconpos="bottom" class="ui-navbar" role="navigation">
<ul class="ui-grid-b">
<li class="ui-block-a">
<a href="http://www.siverekhaber.net/mobil/galeriler.html" data-icon="camera"
class="ui-link ui-btn ui-icon-camera ui-btn-icon-bottom">Galeri</a>
</li>
<li class="ui-block-b">
<a href="http://www.siverekhaber.net/mobil/videolar.html" data-icon="video"
class="ui-link ui-btn ui-icon-video ui-btn-icon-bottom">Video</a>
</li>
<li class="ui-block-c">
<a href="http://www.siverekhaber.net/mobil/yazarlar.html" data-icon="edit"
class="ui-link ui-btn ui-icon-edit ui-btn-icon-bottom">Yazarlar</a>
</li>
</ul>
</div>

我尝试覆盖 onPageFinished 方法:

@Override
public void onPageFinished(WebView view, String url) {
view.setVisibility(View.VISIBLE);
final Animation fade = new AlphaAnimation(0.0f, 1.0f);
fade.setDuration(200);
view.startAnimation(fade);
view.setVisibility(View.VISIBLE);
mRefreshPbar.setVisibility(View.INVISIBLE);
mRefreshBtn.setVisibility(View.VISIBLE);
updateActionView();
mWebview.loadUrl("javascript:(function() { " +
"if (typeof(document.getElementsByClassName('ui-footer')[0]) != 'undefined' && document.getElementsByClassName('ui-footer')[0] != null){"+
"document.getElementsByClassName('ui-footer')[0].style.display = 'none';"+
"})()");
}

但它不起作用。有什么问题?

最佳答案

您需要调用void 0 来阻止浏览器重定向到纯文本文件。

mWebview.loadUrl("javascript:if (typeof(document.getElementsByClassName('ui-footer')[0]) != 'undefined' && document.getElementsByClassName('ui-footer')[0] != null){document.getElementsByClassName('ui-footer')[0].style.display = 'none';} void 0");

关于android - 如何从 webview 中删除类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29881955/

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