Skip to content

Instantly share code, notes, and snippets.

@dinnouti
Last active January 30, 2020 22:02
Show Gist options
  • Save dinnouti/e348b77c14dca157188ff0ae704e84dc to your computer and use it in GitHub Desktop.
Save dinnouti/e348b77c14dca157188ff0ae704e84dc to your computer and use it in GitHub Desktop.
Copy URL as Markdown as a browser bookmark
// Chrome version
javascript: (function() {
let text = '[' + document.title + '](' + location.href + ')';
navigator.clipboard.writeText(text)
.then(() => {
console.log('Text copied to clipboard: ', text);
})
.catch(err => {
console.error('Could not copy text: ', err);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment