Created
April 25, 2024 07:55
-
-
Save gcsecsey/4bbef0ec6d04af833929bc685243e012 to your computer and use it in GitHub Desktop.
Userscript for copying current page title and URL as a link
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
// ==UserScript== | |
// @name Copy page title link on Ctrl+CMD+Option+C | |
// @description Copy the title and URL of the current page to the clipboard | |
// @version 0.1 | |
// @match http*://*/* | |
// @grant GM_setClipboard | |
// ==/UserScript== | |
document.addEventListener('keydown', e => { | |
if (e.code === 'KeyC' && e.ctrlKey && e.altKey && e.metaKey) { | |
const linkHtml = '<a href="' + window.location.href + '">' + document.title + '</a>'; | |
GM_setClipboard(linkHtml, 'html'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment