Bookmarklet: Click to copy just the main URL

Recently the links on SC started to include information about layout and the display of references. Yay! That way you can send a link to a specific passage and know that the person you send it to will see exactly what you want them to.

But now the links are long and a tad bit ugly.

So I created a bookmarklet to allow you to copy just the basic part of the url to your clipboard in case you want to use it somewhere that you don’t need all that other info:

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

It’s really nothing fancy, and it won’t hurt anything in your browser.

How do you use it? Manually create a bookmark in your browser (probably just right click on your bookmark toolbar and select something like Add Bookmark. You can give it whatever name you like, or maybe just an emoji. Then in the URL field, paste the code above. Save, and that’s it.

Now when you are on a link (or any other site for that matter, e.g. just click that bookmark and it will copy the link to your clipboard. Then paste it wherever you like.


That’s cool. There are always costs and benefits!

Another way to grab the “bare” URL is from the suttaplex. If you’re on a sutta, click “Parallels”, then right-click and copy the URL from the relevant text.

If there’s demand, we could make make this available more directly in the UI. But my feeling is, most people don’t worry that much.


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](

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](
1 Like