Skip to content

Instantly share code, notes, and snippets.

@cemeyer
Created April 15, 2014 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemeyer/10743272 to your computer and use it in GitHub Desktop.
Save cemeyer/10743272 to your computer and use it in GitHub Desktop.
Facebook: nuke right column (crap and ads)
// ==UserScript==
// @name Facebook: Kill rightcol
// @namespace facebook.com
// @include https://www.facebook.com/*
// @include http://www.facebook.com/*
// @include https://facebook.com/*
// @include http://facebook.com/*
// @version 1
// @grant none
// ==/UserScript==
// Resources:
// https://stackoverflow.com/questions/1804991/remove-dom-element-without-knowing-its-parent
(function(){
function log(t){
console.log("FBRightCol: " + t);
}
function reschedule(f){
log("Not loaded enough, re-scheduling");
window.setTimeout(f, 100);
}
function run(){
log("Started");
// wait for page to finish loading
var fim_con = document.getElementById('sound_player_holder');
if (fim_con == null) {
reschedule(run);
return;
}
var div = document.getElementById('rightCol');
if (div == null) {
log("Found footer but not div -- aborting.")
return;
}
div.hidden = true;
div.style.setProperty("display", "none", "important");
div.parentNode.removeChild(div);
log("Finished!");
}
log("Loaded.");
window.setTimeout(run, 5);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment