Created
September 18, 2025 18:00
-
-
Save ulrischa/405b93646a0114986575000dcc02b46b to your computer and use it in GitHub Desktop.
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
| javascript:(()=>{const selectedText=window.getSelection().toString().trim();if(!selectedText){alert("You need to select some text!");return;}const url=new URL(window.location);url.hash=`:~:text=${encodeURIComponent(selectedText)}`;navigator.clipboard.writeText(url.toString()).then(()=>{alert("Copied to clipboard:\n"+url.toString());}).catch(()=>{alert("Error: Could not copy to clipboard.\n"+url.toString());});})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment