// ==UserScript== // @name remove the jump link in BAIDU // @author burningall // @description 去除百度搜索跳转链接 // @version 2015.9.14 // @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(win,doc) { //=====配置参数====== var config = { // 需要跳转的链接 macthRules: 'a[href*="www.baidu.com/link?url"]:not([transcoding]):not([transcoded]):not([transcodedAll]):not(.m)', // 请求失败,需要再次请求的链接 reloadRules: 'a[transcoded*="false"]', // 是否需要请求动画,false为关闭动画,默认为true,开启 isAnimate: GM_getValue("isAnimate",true), // 是否正在请求全部,不要修改 transcodingAll:false, // 混合请求,默认开启 mixRequireMod:true }; //匹配正则 var regRules = { // 判断是否为跳转链接 isJumpLink: /www.baidu.com\/link\?url=/ig, // 对请求返回的数据进行切割 sliceResponse: { step1: /.*window\.location\.replace\(\"(.*)\"\).*$/img, step2: /^(.*)(