// ==UserScript== // @name Kill TieBa AD // @name:zh-CN 贴吧广告清理 // @name:zh-TW 貼吧廣告去除 // @namespace hoothin // @version 1.3.2 // @description Just Kill TieBa AD // @description:zh-CN 清理百度贴吧(tieba.baidu.com)内的列表伪装,帖内伪装,触点广告,页首广告,推荐应用等各类广告 // @description:zh-TW 去除百度貼吧(tieba.baidu.com)内的列表偽裝,帖內偽裝,觸點廣告,頁首廣告,推薦應用等各類廣告 // @author hoothin // @include http*://tieba.baidu.com/* // @exclude http*://tieba.baidu.com/ // @exclude http*://tieba.baidu.com/index.html // @grant none // @run-at document-body // @supportURL http://www.hoothin.com // @license MIT License // @compatible chrome // @compatible firefox // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=rixixi@sina.com&item_name=Greasy+Fork+donation // @contributionAmount 1 // @downloadURL https://update.greasyfork.icu/scripts/24171/Kill%20TieBa%20AD.user.js // @updateURL https://update.greasyfork.icu/scripts/24171/Kill%20TieBa%20AD.meta.js // ==/UserScript== (function() { 'use strict'; var observer, option; var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; var tcss = ".j_encourage_entry,#video_frs_head,#encourage_entry,.tpoint-skin,#pb_adbanner,.iframe_wrapper,div.tpoint-skin,.j_click_stats,#thread_list>li:not(.j_thread_list):not(.thread_top_list_folder),#j_p_postlist>.clearfix:not([data-field*=post_id]){display:none !important;}"; var snod = document.createElement('style'); snod.innerHTML = tcss; document.getElementsByTagName("head")[0].appendChild(snod); var content = document.querySelector("#content"); if(content){ delAD("#thread_list","LI"); observer = new MutationObserver(function(records){ delAD("#thread_list","LI"); }); option = { 'childList': true, 'subtree': true }; observer.observe(content, option); }else{ content=document.querySelector(".l_container"); if(content){ delAD("#j_p_postlist","DIV"); observer = new MutationObserver(function(records){ delAD("#j_p_postlist","DIV"); }); option = { 'childList': true, 'subtree': true }; observer.observe(content, option); }else{ content=document.querySelector(".post_list"); if(content){ delAD(".threads_list","LI"); observer = new MutationObserver(function(records){ delAD(".threads_list","LI"); }); option = { 'childList': true, 'subtree': true }; observer.observe(content, option); } } } function delAD(a,b){ var threadList = document.querySelector(a+">"+a),i; if(!threadList) threadList = document.querySelector(a); if(!threadList) return; var delList = []; for(i=0;i