// ==UserScript== // @name 直接访问链接 // @description 避免链接的二次点击 // @namespace https://gitee.com/inch_whf/tampermonkey-script-inch // @version 1.5 // @author wuhongfei // @license MIT // @grant none // @include * // @downloadURL none // ==/UserScript== (function(){ // 获得重定向的href,前面的优先 var href = // 百度贴吧 window.location.host == "jump.bdimg.com" && window.location.pathname == "/safecheck/index" && document.querySelector(".link").innerHTML // 参数target:掘金、知乎 || new URL(window.location.href).searchParams.get("target") // 参数url:简书 || new URL(window.location.href).searchParams.get("url"); console.log(href); if( href != null && href.startsWith("http") ){ window.location.href = decodeURIComponent(href); } })();