Last active
April 17, 2022 10:38
-
-
Save hexium310/ca2dbf3a4aaceefdaf8122fd2e25713a to your computer and use it in GitHub Desktop.
Copy title and URL to clipboard
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:{const t=document.title+" "+location.href,o=t=>{window.prompt("",t)};navigator?.clipboard?.writeText(t).catch(()=>{o(t)})||o(t)} |
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
(() => { | |
const content = `${ document.title } ${ location.href }`; | |
const showPrompt = (content) => { | |
window.prompt('', content); | |
}; | |
navigator?.clipboard?.writeText(content).catch(() => { | |
showPrompt(content); | |
}) || showPrompt(content); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment