// ==UserScript== // @name remove the jump link in BAIDU (ECMA6) // @author axetroy // @collaborator axetroy // @description 去除百度搜索跳转链接 // @version 2016.4.17 // @grant GM_xmlhttpRequest // @include *www.baidu.com* // @connect *www.baidu.com* // @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;g=0&&l():e>=0?l():c&&(k=setTimeout(l,-e)),i=h}},e=function(a,b,c){return d(a,b,c,!0)};b.exports={$debounce:e,$throttle:d}},{}],3:[function(a,b,c){"use strict";var d=a("./$q"),e=a("./jqLite"),f=function(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=d.defer(),c=function(c){4===c.readyState&&(c.requestUrl=a.url,/^(2|3)/.test(c.status)||c.finalUrl?b.resolve(c):b.reject(c))},f=function(c){c.requestUrl=a.url,c&&c.finalUrl?b.resolve(c):b.reject(c)},g=function(c){c.requestUrl=a.url,c&&c.finalUrl?b.resolve(c):b.reject(c)};return a=e.fn.merge({onreadystatechange:c,ontimeout:f,onerror:g},a),new RegExp("^"+window.location.protocol).test(a.url)||(a.url=a.url.replace(/^(http|https):/im,window.location.protocol)),GM_xmlhttpRequest(a),b.promise};["HEAD","GET","POST"].forEach(function(a){f[a.toLocaleLowerCase()]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],g=d.defer();return c=e.fn.merge(c,{url:b,method:a}),f(c).then(function(a){g.resolve(a)},function(a){g.reject(a)}),g.promise}}),f.jsonp=function(a){var b=d.defer(),c=document.createElement("script");return c.setAttribute("type","text/javascript"),c.src=a+"?callback=func",document.body.appendChild(c),b.promise},b.exports=f},{"./$q":4,"./jqLite":5}],4:[function(a,b,c){"use strict";var d=a("es6-promise"),e=(d.polyfill,d.Promise),f=function(){var a=arguments.length<=0||void 0===arguments[0]?noop:arguments[0];return new e(a)};f.defer=function(){var a={};return a.promise=new e(function(b,c){a.resolve=function(a){b(a)},a.reject=function(a){c(a)}}),a},f.resolve=function(a){return f(function(b,c){b(a)})},f.reject=function(a){return f(function(b,c){c(a)})},b.exports=f},{"es6-promise":6}],5:[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=function(){function a(a,b){for(var c=0;cd||b.bottom<0||b.left>c||b.right<0,!e):void 0},b=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,merge:b}}}]),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},{}],6:[function(a,b,c){(function(c,d){(function(){"use strict";function e(a){return"function"==typeof a||"object"==typeof a&&null!==a}function f(a){return"function"==typeof a}function g(a){T=a}function h(a){X=a}function i(){return function(){c.nextTick(n)}}function j(){return function(){S(n)}}function k(){var a=0,b=new $(n),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function l(){var a=new MessageChannel;return a.port1.onmessage=n,function(){a.port2.postMessage(0)}}function m(){return function(){setTimeout(n,1)}}function n(){for(var a=0;W>a;a+=2){var b=ba[a],c=ba[a+1];b(c),ba[a]=void 0,ba[a+1]=void 0}W=0}function o(){try{var b=a,c=b("vertx");return S=c.runOnLoop||c.runOnContext,j()}catch(d){return m()}}function p(a,b){var c=this,d=c._state;if(d===fa&&!a||d===ga&&!b)return this;var e=new this.constructor(r),f=c._result;if(d){var g=arguments[d-1];X(function(){H(d,e,g,f)})}else D(c,e,a,b);return e}function q(a){var b=this;if(a&&"object"==typeof a&&a.constructor===b)return a;var c=new b(r);return z(c,a),c}function r(){}function s(){return new TypeError("You cannot resolve a promise with itself")}function t(){return new TypeError("A promises callback cannot return that same promise.")}function u(a){try{return a.then}catch(b){return ha.error=b,ha}}function v(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function w(a,b,c){X(function(a){var d=!1,e=v(c,b,function(c){d||(d=!0,b!==c?z(a,c):B(a,c))},function(b){d||(d=!0,C(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,C(a,e))},a)}function x(a,b){b._state===fa?B(a,b._result):b._state===ga?C(a,b._result):D(b,void 0,function(b){z(a,b)},function(b){C(a,b)})}function y(a,b,c){b.constructor===a.constructor&&c===ca&&constructor.resolve===da?x(a,b):c===ha?C(a,ha.error):void 0===c?B(a,b):f(c)?w(a,b,c):B(a,b)}function z(a,b){a===b?C(a,s()):e(b)?y(a,b,u(b)):B(a,b)}function A(a){a._onerror&&a._onerror(a._result),E(a)}function B(a,b){a._state===ea&&(a._result=b,a._state=fa,0!==a._subscribers.length&&X(E,a))}function C(a,b){a._state===ea&&(a._state=ga,a._result=b,X(A,a))}function D(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+fa]=c,e[f+ga]=d,0===f&&a._state&&X(E,a)}function E(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d,e,f=a._result,g=0;gg;g++)D(d.resolve(a[g]),void 0,b,c);return e}function L(a){var b=this,c=new b(r);return C(c,a),c}function M(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function O(a){this._id=ma++,this._state=void 0,this._result=void 0,this._subscribers=[],r!==a&&("function"!=typeof a&&M(),this instanceof O?I(this,a):N())}function P(a,b){this._instanceConstructor=a,this.promise=new a(r),Array.isArray(b)?(this._input=b,this.length=b.length,this._remaining=b.length,this._result=new Array(this.length),0===this.length?B(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&B(this.promise,this._result))):C(this.promise,this._validationError())}function Q(){var a;if("undefined"!=typeof d)a=d;else if("undefined"!=typeof self)a=self;else try{a=Function("return this")()}catch(b){throw new Error("polyfill failed because global object is unavailable in this environment")}var c=a.Promise;c&&"[object Promise]"===Object.prototype.toString.call(c.resolve())&&!c.cast||(a.Promise=na)}var R;R=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)};var S,T,U,V=R,W=0,X=function(a,b){ba[W]=a,ba[W+1]=b,W+=2,2===W&&(T?T(n):U())},Y="undefined"!=typeof window?window:void 0,Z=Y||{},$=Z.MutationObserver||Z.WebKitMutationObserver,_="undefined"!=typeof c&&"[object process]"==={}.toString.call(c),aa="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ba=new Array(1e3);U=_?i():$?k():aa?l():void 0===Y&&"function"==typeof a?o():m();var ca=p,da=q,ea=void 0,fa=1,ga=2,ha=new F,ia=new F,ja=J,ka=K,la=L,ma=0,na=O;O.all=ja,O.race=ka,O.resolve=da,O.reject=la,O._setScheduler=g,O._setAsap=h,O._asap=X,O.prototype={constructor:O,then:ca,"catch":function(a){return this.then(null,a)}};var oa=P;P.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},P.prototype._enumerate=function(){for(var a=this.length,b=this._input,c=0;this._state===ea&&a>c;c++)this._eachEntry(b[c],c)},P.prototype._eachEntry=function(a,b){var c=this._instanceConstructor,d=c.resolve;if(d===da){var e=u(a);if(e===ca&&a._state!==ea)this._settledAt(a._state,b,a._result);else if("function"!=typeof e)this._remaining--,this._result[b]=a;else if(c===na){var f=new c(r);y(f,a,e),this._willSettleAt(f,b)}else this._willSettleAt(new c(function(b){b(a)}),b)}else this._willSettleAt(d(a),b)},P.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===ea&&(this._remaining--,a===ga?C(d,c):this._result[b]=c),0===this._remaining&&B(d,this._result)},P.prototype._willSettleAt=function(a,b){var c=this;D(a,void 0,function(a){c._settledAt(fa,b,a)},function(a){c._settledAt(ga,b,a)})};var pa=Q,qa={Promise:na,polyfill:pa};"function"==typeof define&&define.amd?define(function(){return qa}):"undefined"!=typeof b&&b.exports?b.exports=qa:"undefined"!=typeof this&&(this.ES6Promise=qa),pa()}).call(this)}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:8}],7:[function(a,b,c){"use strict";!function(){var b=a("./../libs/jqLite"),c=a("./src/init"),d=a("./src/observe"),e=a("./src/mouseover"),f=a("./src/scroll");b(function(){c(),d(),e(),f()}),console.info("去跳转启动...")}()},{"./../libs/jqLite":5,"./src/init":10,"./src/mouseover":12,"./src/observe":13,"./src/scroll":14}],8:[function(a,b,c){function d(){k=!1,h.length?j=h.concat(j):l=-1,j.length&&e()}function e(){if(!k){var a=setTimeout(d);k=!0;for(var b=j.length;b;){for(h=j,j=[];++l1)for(var c=1;c]*|link=[^>])/g,"");var d=document.createElement("html");d.innerHTML=c,e(".t>a:not(.OP_LOG_LINK):not([decoded])").each(function(a){e(".f>a",d).each(function(b){e(a).text===e(b).text&&(a.href=b.href,e(a).attr("decoded",!0))})}),a.resolve(b)}},function(b){h.isDecodingAll=!1,a.reject(b)}),a.promise},a.prototype.one=function(a){var b=f.defer();return e(a).attr("decoding",!0),g.head(a.href,{timeout:2e3,anonymous:!0}).then(function(c){e(a).attr("href",c.finalUrl).attr("decoded",!0).removeAttr("decoding"),b.resolve(c)},function(c){e(a).removeAttr("decoding"),b.reject(c)}),b.promise},a.prototype.oneByOne=function(){var b=this;return e(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)&&!e(a).attr("decoded")&&!e(a).attr("decoding")},a}();b.exports=i},{"../../libs/$http":3,"../../libs/$q":4,"../../libs/jqLite":5,"./config":9}],12:[function(a,b,c){"use strict";var d=a("../../libs/jqLite"),e=a("../../libs/$debounce").$debounce,f=a("./main"),g=e(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 f).one(b)},100,!0),h=function(){d(document).bind("mouseover",function(a){g(a)})};b.exports=h},{"../../libs/$debounce":2,"../../libs/jqLite":5,"./main":11}],13:[function(a,b,c){"use strict";var d=a("../../libs/jqLite"),e=a("../../libs/$debounce").$debounce,f=a("../../libs/$addStyle"),g=a("./main"),h=a("./init"),i=a("./config"),j=function(){var a=e(function(a){var b=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];b.length&&(i.isDecodingAll?new g(i.rules).oneByOne():h(),i.debug&&f(i.debugStyle))},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=j},{"../../libs/$addStyle":1,"../../libs/$debounce":2,"../../libs/jqLite":5,"./config":9,"./init":10,"./main":11}],14:[function(a,b,c){"use strict";var d=a("../../libs/jqLite"),e=a("../../libs/$debounce").$debounce,f=a("../../libs/$addStyle"),g=a("./main"),h=a("./config"),i=function(){var a=e(function(){new g(h.rules).oneByOne(),h.debug&&f(h.debugStyle)},100);d(window).bind("scroll",function(){a()})};b.exports=i},{"../../libs/$addStyle":1,"../../libs/$debounce":2,"../../libs/jqLite":5,"./config":9,"./main":11}]},{},[7]); //# sourceMappingURL=index.map /* jshint ignore:end */