Created
December 8, 2011 20:17
-
-
Save peterbraden/1448369 to your computer and use it in GitHub Desktop.
Facebook Greasemonkey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name pb-fb | |
// @namespace fb | |
// @description fb | |
// @include https://www.facebook.com/ | |
// ==/UserScript== | |
document.getElementById("blueBar").style.setProperty("position", "absolute", "important"); | |
var _findByVal = function(tag, val, cb){ | |
for (var i=0, arr = document.getElementsByTagName(tag); i<arr.length; i++){ | |
var v = arr[i].childNodes[0] && arr[i].childNodes[0].nodeValue; | |
if (v == val){cb(arr[i])} | |
} | |
} | |
// Kill sponsored sidebars | |
_findByVal('h4', 'Sponsored', function(x){ | |
x.parentNode.parentNode.parentNode.parentNode.style.setProperty('display', 'none', 'important') | |
}) | |
_findByVal('h4', 'Sponsored story', function(x){ | |
x.parentNode.parentNode.parentNode.parentNode.style.setProperty('display', 'none', 'important') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment