Bookmarklet: Click to copy just the main URL

And just to be clear, I welcome the more info packed urls. But sometimes I just want the simple one. Of course I could also just select it from the url bar. But that can introduce errors.

And yes, this is probably something not many people would need.

Here’s a version that copies a short markdown version of the link to the clipboard:

javascript: (() => {navigator.clipboard.writeText("[" + document.title.replace(/—.+$/, "") + "](" + window.location.href.replace(/\?.+$/, "") + ")");})();

For example:

[MN 152: Indriyabhāvanāsutta](https://suttacentral.net/mn152/en/sujato)

And this one to create a full markdown version:

javascript: (() => {navigator.clipboard.writeText("[" + document.title + "](" + window.location.href + ")");})();

for example:

[MN 152: Indriyabhāvanāsutta—Bhikkhu Sujato](https://suttacentral.net/mn152/en/sujato?layout=sidebyside&reference=main/csp&notes=asterisk&highlight=true&script=latin)
1 Like