UC浏览器自动添加给网页一些关键字添加蓝色链接的解决办法网站
UC浏览器真特么的烦人,在页面强制插入JS,强制给关键词加入神马搜索链接,通过以下代码可以轻松清除,基于JQ:
function CaoNiMaDeUc(){
$("a").each(function(index, element) {
...
UC浏览器真特么的烦人,在页面强制插入JS,强制给关键词加入神马搜索链接,通过以下代码可以轻松清除,基于JQ:
function CaoNiMaDeUc(){
$("a").each(function(index, element) {
try{
var thishref=$(this).attr("href");
var thisText=$(this).html();
if(thishref.indexOf("uc.cn")>=0){
$(this).replaceWith(thisText);
}
}
catch(e){
}
});
$("script").each(function(index, element) {
try{
var thissrc=$(this).attr("src");
if(thissrc.indexOf("ucbrowser")>=0){
$(this).remove();
}
}
catch(e){
}
});
}
上面是清除用的函数,页面下载完成执行下面代码:
$(function(){
var pageDATA_ua = window.navigator.userAgent.toLowerCase();
if(pageDATA_ua.indexOf('ucbrowser')>=0){setInterval("CaoNiMaDeUc();",1000);}
});
当然,还有设置a标签颜色的方法,不过没有用过
今天就到这里了,谢谢各位老铁
function CaoNiMaDeUc(){
$("a").each(function(index, element) {
try{
var thishref=$(this).attr("href");
var thisText=$(this).html();
if(thishref.indexOf("uc.cn")>=0){
$(this).replaceWith(thisText);
}
}
catch(e){
}
});
$("script").each(function(index, element) {
try{
var thissrc=$(this).attr("src");
if(thissrc.indexOf("ucbrowser")>=0){
$(this).remove();
}
}
catch(e){
}
});
}
上面是清除用的函数,页面下载完成执行下面代码:
$(function(){
var pageDATA_ua = window.navigator.userAgent.toLowerCase();
if(pageDATA_ua.indexOf('ucbrowser')>=0){setInterval("CaoNiMaDeUc();",1000);}
});
当然,还有设置a标签颜色的方法,不过没有用过
今天就到这里了,谢谢各位老铁
最新评论
热门推荐
我要评论