Skip to content

Instantly share code, notes, and snippets.

@TheFrostlixen
Last active August 30, 2023 06:54
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save TheFrostlixen/9e5c66dc8916e95e6065 to your computer and use it in GitHub Desktop.
Save TheFrostlixen/9e5c66dc8916e95e6065 to your computer and use it in GitHub Desktop.
Bookmarklets - JavaScript apps for your web browser

Bookmarklets

A bookmarklet is a javascript app that you save in your web browser as a bookmark. You simply click it and it will perform a task on that webpage.

My Bookmarklets

  • CleanReddit.js Removes the header and side panel from Reddit pages. Makes it look a little more clean (and less like you're not working at your desk).
  • QRthis.js Use Google's API to generate a QR code for the website you're on.
  • RandomWiki.js Takes you to a random Wikipedia article
  • RevealPasswords.js Reveal any hidden passwods on the page. Pops up in an alert message.
  • skeltal.js Replace all images on the page with our skeltal overlord.
  • SMMRY.js Uses SMMRY's API to automatically generate a summary of the webpage you're on.
  • Upvote.js Upvotes all comments/posts on a page on Reddit. Spread the love.
  • WaybackCache.js Opens the current page in the Wayback Machine Internet Archive.

How To Add Icons To Bookmarklets

  1. Export your bookmarks to an HTML file.
  2. Use a tool to turn a 16x16 image into BASE64 format.
  3. Open the exported HTML file in Notepad++ or some other editor.
  4. Find your bookmarklet and add the attribute ICON="base 64 code goes here".
  5. Save it and re-import your bookmarks HTML file. This should cause your existing bookmarklets to update with the icon (or the imported ones will have the icon at least) and you can delete the duplicates.
javascript:(function() {
var target = document.querySelector( 'input:focus' ),
list=Array.from(document.querySelectorAll( 'input[type=radio][value="' + target.value + '"]' )),
i = list.findIndex( v => v === target );
console.log(i);
list.slice(i).forEach( v => v.click() );
} )();
void(0);
javascript:document.getElementsByClassName("side")[0].remove();
document.getElementById("header").remove();
document.getElementsByClassName("panestack-title")[0].remove();
document.getElementsByClassName("menuarea")[0].remove();
document.getElementsByClassName("usertext cloneable")[0].remove();
document.getElementsByName("content")[0].remove();
javascript:window.location='http://chart.googleapis.com/chart?cht=qr&chs=150x150&choe=UTF-8&chld=H&chl='+location.href;
javascript:
var l = location;
var h = l.href;
if( h.match(/wikipedia\.org\//) )
{
l.href = document.querySelector("a[accesskey='x']").href
}
javascript:(function() {
var s,F,j,f,i;
s = "";
F = document.forms;
for(j=0; j<F.length; ++j) {
f = F[j];
for (i=0; i<f.length; ++i) {
if (f[i].type.toLowerCase() == "password")
s += f[i].value + "\n";
}
}
if (s)
alert("Passwords in forms on this page:\n" + s);
else
alert("There are no passwords in forms on this page.");
})();
javascript:
var ayy = {
lmao: function() {
Array.prototype.forEach.call( document.getElementsByTagName("img"), function(el) {
el.src = "https://i.imgur.com/07AmS0I.jpg";
} );
}
};
ayy.lmao();
javascript:(function(){window.location='http://smmry.com/'+location.href})();
javascript:(function() {
var q=[];
$('.up').each(function() {
var that=this;
var f=function(index) {
$(that).trigger('click');
$(that).trigger('mousedown');
setTimeout(function() {
if(q[index]){
q[index](index+1);
} else {
if(upVoteTimer) {
window.clearTimeout(upVoteTimer);
}
}
} ,500);
};
q.push(f);
});
var upVoteTimer=window.setTimeout(function() {
q[0](1);
} ,50);
}());
javascript:window.location.href='https://web.archive.org/web/'+window.location.href.replace(/^https?:\/\//i, '');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment