您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
添加常用网站导航
// ==UserScript== // @name 快捷导航栏 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 添加常用网站导航 // @author YourName // @match https://*/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // 创建导航栏 const nav = document.createElement('div'); nav.style.cssText = ` position: fixed; top: 0; left: 0; right: 0; background: #333; padding: 10px; z-index: 9999; `; // 添加链接 const links = [ { name: '百度', url: 'https://www.baidu.com' }, { name: '知乎', url: 'https://www.zhihu.com' }, { name: 'GitHub', url: 'https://github.com' } ]; links.forEach(link => { const a = document.createElement('a'); a.href = link.url; a.textContent = link.name; a.style.cssText = ` color: white; margin: 0 10px; text-decoration: none; `; nav.appendChild(a); }); document.body.prepend(nav); // 为了不遮挡内容,给body添加上边距 document.body.style.marginTop = '40px'; })();