// ==UserScript== // @name AC-百度去广告 // @namespace ACNoAdd // @description 去掉百度的推广链接 // @include http://www.baidu.com/* // @include https://www.baidu.com/* // @version 3.0 // @grant none // @author AC // @icon https://coding.net/u/zb227/p/zbImg/git/raw/master/img0/icon.jpg // @run-at document-end // @downloadURL none // ==/UserScript== mo = new MutationObserver(function(allmutations) { allmutations.map(function(oneNode){ //if(oneNode.addedNodes[0]){ //如果存在增加的点 // console.log(oneNode); //} }); removeAD(); }); var targets = document.body; mo.observe(targets, {'childList': true,'characterData':true,'subtree': true}); function removeAD(){ var no = document.getElementById("content_right"); if(no != null) no.remove(); var father = document.querySelectorAll("#content_left")[0].childNodes; var lastId = 0; for(var i = 0; i < father.length; i++){ if((father[i].outerHTML+"").indexOf("