faehnri.ch

Handy Bookmarklets

tiny scripts for a button in your browser

2020-08-17


Bookmarklets are a small bit of code you can put in a bookmark button in a browser. Here are a couple I keep that are handy.

💾 Archive.org's Wayback Machine

You can instantly archive the webpage you're on with the click of a button. Add a new bookmark to your browser. In Firefox, I right click the shortcut menu bar and say add new bookmark.

Give it a name then under location put this:

javascript:location.href = '//web.archive.org/save/' + location.href.split('?')[0];

That code is run on the current web page when you click your bookmark. It'll direct you to the archive.org site to save the page.

Looking at the script, you could also just load "web.archive.org/save/[URL]" in a browser.

📌 Pinboard

I use pinboard a lot to save links.

javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('https://pinboard.in/add?url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p),'Pinboard','toolbar=no,width=700,height=350'));

🪜12ft

12ft is a tool to get around paywalls. It doesn't always work.

javascript:location.href = '//12ft.io/' + location.href.split('?')[0];

📜 Scribe.rip

Here's a tool for Medium to get around their registration requirement. You just relace medium.com in the URL with scribe.rip.

javascript:q=new URL(location.href);q.hostname='scribe.rip';location.href=q

🖼️Open Cleveland Art

Open a random piece of art from the Cleveland Museum of Art open collection.

javascript:fetch('https://openaccess-api.clevelandart.org/api/artworks/?has_image=1&skip='+ Math.floor(Math.random()*36358) + "&limit=1").then(res => res.json()).then(out => void(open(out['data'][0]['url'])));

🦘Wallabag

Add an article to Wallabag. Replace the address with the address of your server. There's a link under "How To". You may have to enable javascript on the blank tab it opens.

javascript:(function(){var url=location.href||url;var wllbg=window.open('[your address]/bookmarklet?url=' + encodeURIComponent(url),'_blank');})();