// ==UserScript== // @name remove the jump link in BAIDU (ECMA6) // @author axetroy // @description 去除百度搜索跳转链接 // @version 2016.4.12 // @grant GM_xmlhttpRequest // @grant GM_addStyle // @include *www.baidu.com* // @connect tags // @connect * // @compatible chrome 完美运行 // @compatible firefox 完美运行 // @supportURL http://www.burningall.com // @run-at document-start // @contributionURL troy450409405@gmail.com|alipay.com // @namespace https://greasyfork.org/zh-CN/users/3400-axetroy // @license The MIT License (MIT); http://opensource.org/licenses/MIT // @downloadURL none // ==/UserScript== // Github源码:https://github.com/axetroy/GMscript/tree/master/remove_baidu_redirect /* jshint ignore:start */ !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gd||b.bottom<0||b.left>c||b.right<0,!e):void 0},b=function(a,b){var c=void 0;return function(){var d=this,e=arguments;window.clearTimeout(c),c=window.setTimeout(function(){a.apply(d,e)},b)}},c=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];return Object.assign.apply(Object,[{}].concat(b))};return{visible:a,debounce:b,merge:c}}}]),a}(),h=function(){var a=arguments.length<=0||void 0===arguments[0]?"":arguments[0],b=arguments.length<=1||void 0===arguments[1]?document:arguments[1];return new g(a,b)};h.fn=g.fn,b.exports=h},{}],5:[function(a,b,c){"use strict";var d={rules:'\n a[href*="www.baidu.com/link?url"]\n :not(.m)\n :not([decoding])\n :not([decoded])\n '.trim().replace(/\n/gim,"").replace(/\s{1,}([^a-zA-Z])/g,"$1"),debug:!1,isDecodingAll:!1};d.debug&&GM_addStyle("\n a[decoded]{\n background-color:green !important;\n color:#303030 !important;\n };\n a[decoding]{\n background-color:yellow !important;\n color:#303030 !important;\n }\n "),b.exports=d},{}],6:[function(a,b,c){"use strict";var d=a("./main"),e=a("../libs/$q"),f=a("./config"),g=function(){new d(f.rules).all().then(function(){return e.resolve(!0)},function(){return e.resolve(!0)}).then(function(){new d(f.rules).oneByOne()})};b.exports=g},{"../libs/$q":3,"./config":5,"./main":7}],7:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var e=a("./config"),f=a("./../libs/jqLite"),g=a("./../libs/$q"),h=a("./../libs/$http"),i=function(){function a(){var b=this,c=arguments.length<=0||void 0===arguments[0]?"":arguments[0];return d(this,a),c?(this.inViewPort=[],void f(c).each(function(a){return f.fn.visible(a)&&b.inViewPort.push(a)})):this}return a.prototype.all=function(){var a=g.defer(),b=window.top.location.href.replace(/(\&)(tn=\w+)(\&)/gim,"$1tn=baidulocal$3");return e.isDecodingAll=!0,h.get(b,{timeout:2e3}).then(function(b){if(e.isDecodingAll=!1,b){var c=b.responseText;c=c.replace(/(src=[^>]*|link=[^>])/g,"");var d=document.createElement("html");d.innerHTML=c,f(".t>a:not(.OP_LOG_LINK):not([decoded])").each(function(a){f(".f>a",d).each(function(b){f(a).text===f(b).text&&(a.href=b.href,f(a).attr("decoded",!0))})}),a.resolve(b)}},function(b){e.isDecodingAll=!1,a.reject(b)}),a.promise},a.prototype.one=function(a){var b=g.defer();return f(a).attr("decoding",!0),h.get(a.href,{timeout:2e3,anonymous:!0}).then(function(c){f(a).attr("href",c.finalUrl).attr("decoded",!0).removeAttr("decoding"),b.resolve(c)},function(c){f(a).removeAttr("decoding"),b.reject(c)}),b.promise},a.prototype.oneByOne=function(){var b=this;return f(this.inViewPort).each(function(c){a.match(c)&&b.one(c)}),this},a.match=function(a){return"A"===a.tagName&&a.href&&/www\.baidu\.com\/link\?url=/im.test(a.href)&&!f(a).attr("decoded")&&!f(a).attr("decoding")},a}();b.exports=i},{"./../libs/$http":2,"./../libs/$q":3,"./../libs/jqLite":4,"./config":5}],8:[function(a,b,c){"use strict";var d=a("../libs/jqLite"),e=a("./main"),f=d.fn.debounce(function(a){var b=a.target;"A"===b.tagName&&b.href&&/www\.baidu\.com\/link\?url=/im.test(b.href)&&!d(b).attr("decoded")&&(new e).one(b)},100),g=function(){return function(){d(document).bind("mouseover",function(a){f(a)})}};b.exports=g()},{"../libs/jqLite":4,"./main":7}],9:[function(a,b,c){"use strict";var d=a("../libs/jqLite"),e=a("./main"),f=a("./init"),g=a("./config"),h=function(){return function(){var a=d.fn.debounce(function(a){var b=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];arguments.length<=2||void 0===arguments[2]?[]:arguments[2];b.length&&(g.isDecodingAll?new e(g.rules).oneByOne():f())},100);d(document).observe(function(b){var c=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],d=arguments.length<=2||void 0===arguments[2]?[]:arguments[2];a(b,c,d)})}};b.exports=h()},{"../libs/jqLite":4,"./config":5,"./init":6,"./main":7}],10:[function(a,b,c){"use strict";var d=a("../libs/jqLite"),e=a("./main"),f=a("./config"),g=function(){return function(){var a=d.fn.debounce(function(){new e(f.rules).oneByOne()},100);d(window).bind("scroll",function(){a()})}};b.exports=g()},{"../libs/jqLite":4,"./config":5,"./main":7}]},{},[1]); //# sourceMappingURL=index.map /* jshint ignore:end */