// ==UserScript== // @name remove the jump link in BAIDU // @author burningall // @description 去除百度搜索跳转链接 // @version 2015.9.22.1.0 // @include *www.baidu.com* // @grant GM_setValue // @grant GM_getValue // @grant GM_registerMenuCommand // @grant GM_xmlhttpRequest // @run-at document-start // @compatible chrome 完美运行 // @compatible firefox 完美运行 // @license The MIT License (MIT); http://opensource.org/licenses/MIT // @supportURL http://www.burningall.com // @contributionURL troy450409405@gmail.com|alipay.com // @namespace https://greasyfork.org/zh-CN/users/3400-axetroy // @downloadURL none // ==/UserScript== (function(d,f,b){var a={macthRules:'a[href*="www.baidu.com/link?url"]:not([transcoding]):not([transcoded]):not([transcodedAll]):not(.m)',transcodingAll:false,mixRequireMod:true};function j(k){return new g(k)}function g(k){this.element=k;return this}g.prototype.addEvent=function(l,k){var n=this.element,m;return n.addEventListener?n.addEventListener(l,function(o){m=d.event?d.event:(o?o:null);m.target=m.target||m.srcElement;k.call(n,m)},false):n.attachEvent("on"+l,function(o){m=d.event?d.event:(o?o:null);m.target=m.target||m.srcElement;k.call(n,m)})};g.prototype.bind=function(o,n){var p=this.element;if(arguments.length==1){for(var k in o){this.addEvent(k,o[k])}}else{if(arguments.length==2){var m=o.split(" "),l=0;while(la"),q={};for(var t=0,p=x.length;ta:not(.OP_LOG_LINK):not([transcoded]):not([transcodedAll])");for(var o in q){for(var s=0,v=w.length;sp||r.bottom<0||r.left>s||r.right<0;o=!n&&k.push(l)}this.inViewPort=k;return this};j(f).bind({"DOMContentLoaded":function(){if(a.transcodingAll===false){i().all(function(){i(a.macthRules).onebyone();var k=f.getElementById("wrapper");j(k).ob({"childList":true,"subtree":true},function(){if(a.transcodingAll||f.querySelectorAll("a[transcodedAll]").length>0){i(a.macthRules).onebyone()}else{i().all(function(){i(a.macthRules).onebyone()})}})})}},"mouseover":function(m){var k=m.target;if(k.tagName=="A"&&/www.baidu.com\/link\?url=/img.test(k.href)&&k.getAttribute("transcoded")!=="true"){var l=k.href.replace("http","https")+"&wd=&eqid=0";e(l,{"beforeFn":function(n){this.setAttribute("transcoding","true")},"successFn":function(p,o){var n=p.match(/\(\"\S+\"\)/img)[0].replace(/^[\(\"]*|[\)\"]*$/img,"");this.href=n;this.removeAttribute("transcoding");this.setAttribute("transcoded","true")}},k)}}});j(d).bind("scroll",function(){i(a.macthRules).onebyone()})})(window,document,undefined);