Last active
October 30, 2025 08:31
-
-
Save SSubPPaRR/29134d4e1431a8f4276f8af0767c7273 to your computer and use it in GitHub Desktop.
twitter/X auto embed url on copy url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Twitter URL Switcher | |
| // @namespace tampermonkey | |
| // @version 0.1 | |
| // @description Switches the domain of Twitter URLs to vxtwitter when copied | |
| // @author SSubPPaRR | |
| // @match https://twitter.com/* | |
| // @match https://x.com/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| document.addEventListener('copy', function(event) { | |
| var clipboardContent = document.getSelection().toString(); | |
| console.log("copied link:", clipboardContent) | |
| if (clipboardContent.match(/https?:\/\/x\.com\/\w+\/status\/\d+(\?s=\d+)?/)) { | |
| var newURL = clipboardContent.replace('https://x', 'https://vxtwitter'); | |
| event.clipboardData.setData('text/plain', newURL); | |
| event.preventDefault(); | |
| } | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment