百度搜索、百度知道、百度百科、百度文库、百度图片、百度视频、百度贴吧、百度地图、百度经验、百度翻译去广告
目前為
// ==UserScript==
// @name 百度全家桶网站去广告
// @namespace https://github.com/HaoNShi/Tampermonkey_Scripts
// @version 1.2
// @icon https://www.baidu.com/favicon.ico
// @description 百度搜索、百度知道、百度百科、百度文库、百度图片、百度视频、百度贴吧、百度地图、百度经验、百度翻译去广告
// @author yixiyin
// @match *://*.baidu.com/*
// @grant none
// @require https://cdn.bootcss.com/jquery/3.5.1/jquery.min.js
// ==/UserScript==
var dom = {};
dom.query = jQuery.noConflict(true);
dom.query(document).ready(function($) {
'use strict';
const refreshTime = 1000; // 检测广告的刷新时间
// 百度搜索去广告
if (location.href.indexOf('www.baidu.com') > 0) {
setInterval(function() {
alert('222');
$(".ad-icon").parent().parent().parent().remove();
$("[cmatchid]").remove();
$("#content_right").remove();
// 品牌广告
$("#top-ad").remove();
$(".ec-pl-container").remove();
// 条目广告
$("span").each(function() {
if ($(this)[0].innerHTML === '广告') {
$(this).parent().parent().remove();
}
})
}, refreshTime);
}
});