您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
复制内容中包含网址时自动在新标签打开该网址
// ==UserScript== // @name 复制网址自动打开新标签页 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 复制内容中包含网址时自动在新标签打开该网址 // @source https://github.com/Phinsin666/Copying-a-URL-automatically-opens-a-new-tab // @author Phinsin666T // @match *://*/* // @grant none // ==/UserScript== (function () { 'use strict'; let lastClipboardText = ''; document.addEventListener('keydown', async (e) => { if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'c') { // 延迟一点读取剪贴板 setTimeout(async () => { try { const text = await navigator.clipboard.readText(); if (!text || text === lastClipboardText) return; lastClipboardText = text; const urlRegex = /(https?:\/\/[^\s]+)/g; const matches = text.match(urlRegex); if (matches && matches.length > 0) { const url = matches[0]; window.open(url, '_blank'); } } catch (err) { console.warn('无法读取剪贴板内容:', err); } }, 100); } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址