Last active
June 21, 2024 21:26
-
-
Save hkitago/1009207b098773cf0a29b76636eb03c5 to your computer and use it in GitHub Desktop.
Bookmarklet to create a link with selected text or page title.
This file contains 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:(()=>{let d=document,w=window,t=(w.getSelection?w.getSelection():d.getSelection?d.getSelection():d.selection.createRange().text);t=t?t.toString():'';let s=((!t||t=='')?d.title:(`"${t}"`))+' '+location.href;w.prompt('',s);})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment