// ==UserScript== // @name FUCK 提示跳转外部网站 // @namespace https://github.com/idcpj // @version 0.5 // @description 自动关闭烦人的跳转到外部网站的安全提醒 // @author idcpj // @match *zhuanlan.zhihu.com/* // @match *www.jianshu.com/go-wild?ac=2&url* // @match *link.zhihu.com/?target=* // @match *gitee.com/link?target=* // @match *link.juejin.cn/?target=* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; setTimeout(()=>{ let btns=[ ".Modal-closeButton", //知乎跳转外部链接 ".actions .button", ".external-link-btn", //码云跳转外部链接 ".middle-page .content .btn", //掘金 ]; btns.map(btn=>{ document.querySelector(btn)?.click(); }) // 使用 xpath let btn_xpath=[ "//div[contains(text(),'继续前往')]" ,//简书 ]; btn_xpath.map(btn=>{ const xpathResult = document.evaluate(btn, document, null, XPathResult.ANY_TYPE, null); let node = xpathResult.iterateNext(); while (node) { node.click() //node = xpathResult.iterateNext(); } }) },200) })();