Admittedly I am lazy, sometimes very lazy.
But who isn't?
I often insert links to interesting websites in markdown files. For this I always have to copy the link from the address bar and type in the title of the page manually.
But JavaScript and bookmarks are your friend!
Save this code as a bookmark and be as lazy as me:
javascript: (function () {
var title = document.title;
var url = window.location.href;
var textarea = document.createElement('textarea');
textarea.value = '[' + title + '](' + url + ')';
document.body.appendChild(textarea);
textarea.select();
document.execCommand('copy');
document.body.removeChild(textarea);
})();
Top comments (0)