// ==UserScript== // @name 掘金外链免点击自动跳转 // @namespace zonahaha // @version 2024-12-20 // @description open external links automatically // @author zonahaha // @match https://link.juejin.cn/?target=http* // @icon https://www.google.com/s2/favicons?sz=64&domain=juejin.cn // @grant none // @run-at document-end // @license WTFPL // @downloadURL none // ==/UserScript== (function() { 'use strict'; setTimeout(()=>{ const btn = document.querySelector('.middle-page .content .btn') if(btn){ btn.click(); btn.innerText = '自动跳转中...'; btn.style.backgroundColor=getRandomColor(); } },0) })(); function getRandomColor() { // 生成随机RGB颜色 const r = Math.floor(Math.random() * 256); const g = Math.floor(Math.random() * 256); const b = Math.floor(Math.random() * 256); return `rgb(${r},${g},${b})`; }