Remove Facebook Like buttons

By rnaud Last update May 5, 2010 — Installed 3,136 times.

Added https

in
Subscribe to Added https 3 posts, 2 voices



Smiths Scriptwright
FirefoxWindows

hey, just threw this into the main remover area because some sites (fark) do this garbage via https


if ((fblike[i].src.search("https://www.facebook.com/plugins/like.php") != -1) || (fblike[i].src.search("http://www.facebook.com/plugins/like.php") != -1) || (fblike[i].src.search("http://www.facebook.com/widgets/like.php") != -1)) fblike[i].parentNode.removeChild(fblike[i]);

 
Gordo Laqua User
FirefoxWindows

Bug fix. Original script only removed every second like iframe. Apparently when you do the call fblike[cx].parentNode.removeChild(fblike[cx]) it changes the fblike array, so you don't need to increment your counter. Only if you find an iframe that you dont want to delete do you need to increment. (also, changed the array index to cx, I have had a hate on for using i as an array index ever sionce I stopped programming in fortran)

// ==UserScript==
// @name Remove Facebook Like buttons
// @namespace http://userscripts.org/users/useridnumber
// @description Remove Facebook Like buttons
// @include http://*
// ==/UserScript==

var fblike = document.getElementsByTagName("iframe");

if(fblike) {
var cx = 0;
while( cx < fblike.length ){
if ((fblike[cx].src.search("https://www.facebook.com/plugins/like.php") != -1) ||
(fblike[cx].src.search("http://www.facebook.com/plugins/like.php") != -1) ||
(fblike[cx].src.search("http://www.facebook.com/widgets/like.php") != -1)) {

fblike[cx].parentNode.removeChild(fblike[cx]);
} else {
cx++;
}
}
}

 
Gordo Laqua User
FirefoxWindows

Forgive the formatting of the previous script...

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel