您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Copies URL and replaces x.com with vxtwitter.com when hotkey is pressed
// ==UserScript== // @name X to vxtwitter URL Copier with Hotkey // @namespace http://tampermonkey.net/ // @version 0.2 // @description Copies URL and replaces x.com with vxtwitter.com when hotkey is pressed // @author rkk1995 // @match https://x.com/* // @grant none // @run-at document-start // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to copy modified URL to clipboard async function copyModifiedURL() { // Parse the current URL let url = new URL(window.location.href); // Check if the host is x.com and replace it with vxtwitter.com if (url.host === 'x.com') { url.host = 'vxtwitter.com'; let modifiedURL = url.href; await navigator.clipboard.writeText(modifiedURL); } } // Add a keydown event listener to the document document.addEventListener('keydown', (event) => { // Check if the hotkey (Ctrl+C) is pressed if (event.ctrlKey && event.code === 'KeyC') { copyModifiedURL(); } }); })();