您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在Github和Deepwiki页面之间添加互相跳转的浮动按钮
// ==UserScript== // @name Github to Deepwiki Jump // @namespace https://greatest.deepsurf.us/zh-CN/scripts/535862-github-to-deepwiki-jump // @version 0.3 // @description 在Github和Deepwiki页面之间添加互相跳转的浮动按钮 // @license MIT // @match https://github.com/* // @match https://deepwiki.com/* // @icon https://github.githubassets.com/favicons/favicon.png // @grant none // @run-at document-end // ==/UserScript== (function() { 'use strict'; // 创建浮动按钮 function createFloatingButton() { const path = window.location.pathname; const button = document.createElement('a'); // 设置按钮样式 button.style.position = 'fixed'; button.style.right = '20px'; button.style.bottom = '20px'; button.style.backgroundColor = '#2b3137'; button.style.color = 'white'; button.style.padding = '10px 15px'; button.style.borderRadius = '5px'; button.style.textDecoration = 'none'; button.style.fontFamily = 'Arial, sans-serif'; button.style.fontWeight = 'bold'; button.style.zIndex = '9999'; button.style.boxShadow = '0 2px 5px rgba(0,0,0,0.2)'; // 根据当前域名设置不同的按钮文本和链接 if (window.location.hostname === 'deepwiki.com') { button.textContent = '返回GitHub'; button.href = `https://github.com${path}`; } else { button.textContent = '跳转Deepwiki'; button.href = `https://deepwiki.com${path}`; } button.target = '_blank'; // 添加悬停效果 button.addEventListener('mouseover', () => { button.style.backgroundColor = '#3f4a56'; }); button.addEventListener('mouseout', () => { button.style.backgroundColor = '#2b3137'; }); // 添加到页面 document.body.appendChild(button); } // 页面加载完成后创建按钮 window.addEventListener('load', createFloatingButton); })();