Cool Chrome Bookmarklets (Wayback machine, recover passwords, etc)

Avi Parshan
2 min readAug 16, 2022
Dall-e render of Javascript

Chrome bookmarklets allow you to type javascript instead of a standard website url.

We can use this to do some fun and useful things. Either make a new bookmark and in the URL field, type this in, or you should be able to copy and drag the text into the bookmark tab as well (you’ll see a plus sign). You can run many (vanilla) JS functions and code within your bookmarklets, but there are some issues with escape characters and formatting.

You can do most of these commands via chrome extensions or AutoHotKeys, but I prefer bookmarklets because they don’t use nearly as much processing power as extensions, are only active once clicked, and are more privacy friendly. This means that you can run a script on a page with a single click, know what code is running and also can see what it logs via the console!

Picture is from searching “JavaScript” in Dall-E

Wayback Machine and site archive:

  • Find old version of page:
javascript: 
void(location.href='https://web.archive.org/web/*/'+escape(location.href.replace(/^https?:\/\//, %27%27).replace(/\/$/, %27%27)));
  • Save current version of page to the archive:
javascript:var url = window.location.href;
window.location.href="https://web.archive.org/save/" + url;
  • Escape paywalled article:
javascript:var url = window.location.href;
window.location.href="https://archive.ph/" + url;

Show password in password form:

javascript: var p=r(); function r(){var g=0;var x=false;var x=z(document.forms);g=g+1;var w=window.frames;for(var k=0;k<w.length;k++) {var x = ((x) || (z(w[k].document.forms)));g=g+1;}if (!x) alert('Password not found in ' + g + ' forms');}function z(f){var b=false;for(var i=0;i<f.length;i++) {var e=f[i].elements;for(var j=0;j<e.length;j++) {if (h(e[j])) {b=true}}}return b;}function h(ej){var s='';if (ej.type=='password'){s=ej.value;if (s!=''){prompt('Password found ', s)}else{alert('Password is blank')}return true;}}

See deleted reddit content:

javascript: document.location =

--

--