干掉UC恶心的广告
手機(jī)UC不僅有惡心的緩存,還有惡心的嵌入廣告。如果使用后清除緩存后發(fā)現(xiàn)沒(méi)有效果,實(shí)際上它是回到了上一次的緩存,而上一次的緩存是沒(méi)有是該代碼會(huì)被嵌入廣告的。
最好的實(shí)驗(yàn)效果就是卸掉重新裝。
直接貼代碼。
 function () {
            var u = navigator.userAgent;
            var p = navigator.platform;
            var w = p.indexOf("Win");
            if (w > -1) {
                //alert("這貨不是手機(jī)");
            } else if (u.indexOf('UCBrowser') > -1) {
                // var ind = 0;
                window["uc-recommend-ad_ucd"] || (
                    window["uc-recommend-ad_ucd"] = setInterval(function () {
                        var ucd = $("iframe[name=uc-recommend-ad]");
                        // ind += ucd.length;
                        if (ucd.length > 0) {
                            ucd.length > 0 && ucd.remove();
                            clearInterval(window["uc-recommend-ad_ucd"]);
                            window["uc-recommend-ad_ucd"] = null;
                            ucd = null;
                            //setTimeout(function() {
                            //    alert("成功過(guò)濾的廣告(" + ind + ")");
                            //}, 10);
                        } else {
                            //   alert("我還在走啊");
                        }
                    }, 500)
                );
                window["uc-recommend-ad_ucda"] || (
                    window["uc-recommend-ad_ucda"] = setInterval(function () {
                        var ucda = $('a[href*="uc.cn/"]');
                        if (ucda.length > 0) {
                            //ind = ucda.length;
                            ucda.each(function () {
                                $(this).before(this.innerText);
                            });
                            $(ucda).remove();
                            ucda = null;
                            clearInterval(window["uc-recommend-ad_ucda"]);
                            window["uc-recommend-ad_ucda"] = null;
                        }
                    }, 5)
                );
                setTimeout(function () {
                    window["uc-recommend-ad_ucda"] != null && (clearInterval(window["uc-recommend-ad_ucda"]), window["uc-recommend-ad_ucda"] = null);
                    window["uc-recommend-ad_ucd"] != null && (clearInterval(window["uc-recommend-ad_ucd"]), window["uc-recommend-ad_ucd"] = null);
                    //alert("我走了");
                }, 8000);
            }
        }
    }
                            總結(jié)
                            
                        - 上一篇: 二级c语言评分标准一样吗,计算机二级评分
 - 下一篇: android 全局 窗口,miui12