// ==UserScript== // @name 屏蔽百度广告 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 这是个优化你百度搜索体验的脚本,有助于帮你屏蔽百度广告宣传! // @author Skity666 // @match https://www.baidu.com/* // @include https://www.baidu.com/* // @grant none // @require https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js // @downloadURL none // ==/UserScript== jQuery.noConflict(); (function($) { 'use strict'; $(document).ready(function() { refresh() var url=window.location.href; setInterval(function(){ if(window.location.href!=url){ url=window.location.href; refresh(); } refresh(); }, 1000); function refresh(){ $(".EC_ppim_new_gap_bottom").remove() $("#content_right").remove(); setTimeout(function(){ $("span").each(function() { if ($(this)[0].innerHTML == '广告') { console.log($(this)[0].innerHTML); $(this).parent().parent().remove(); } }) $("a").each(function() { if ($(this)[0].innerHTML == '评价') { console.log($(this)[0].innerHTML); $(this).parent().parent().remove(); } }) $(".EC_ppim_new_gap_bottom").remove() $("#content_right").remove(); }, 1000); } }); // Your code here... })(jQuery);