您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Copies the current page URL with Alt+C
当前为
// ==UserScript== // @name Copy Page URL on Alt+C with Top Center Toast // @namespace http://tampermonkey.net/ // @version 1.1 // @description Copies the current page URL with Alt+C // @author Druid // @license MIT // @match *://*/* // @grant none // ==/UserScript== (function () { 'use strict'; document.addEventListener('keydown', function (event) { if (event.altKey && event.code === 'KeyC') { event.preventDefault(); const currentUrl = window.location.href; navigator.clipboard.writeText(currentUrl).then(() => { showToast("Page link copied!"); }).catch(err => { showToast("Failed to copy link."); console.error("Clipboard copy failed:", err); }); } }); function showToast(message) { const toast = document.createElement('div'); toast.textContent = message; Object.assign(toast.style, { position: 'fixed', top: '30px', left: '50%', transform: 'translateX(-50%)', background: '#222', color: '#fff', padding: '10px 20px', fontSize: '16px', borderRadius: '6px', boxShadow: '0 4px 12px rgba(0,0,0,0.2)', zIndex: '9999', opacity: '0', transition: 'opacity 0.3s ease-in-out', }); document.body.appendChild(toast); // Fade in requestAnimationFrame(() => { toast.style.opacity = '1'; }); // Fade out and remove after 2 seconds setTimeout(() => { toast.style.opacity = '0'; setTimeout(() => toast.remove(), 300); }, 2000); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址