Skip to content

Instantly share code, notes, and snippets.

@ShivrajRath
Last active December 18, 2015 21:19
Show Gist options
  • Save ShivrajRath/5846844 to your computer and use it in GitHub Desktop.
Save ShivrajRath/5846844 to your computer and use it in GitHub Desktop.
Facebook Clean Bookmarklet
/*
A bookmarklet to give a cleaner facebook UX
Removes the side ads and ads present inside userstories
Update 1: Toggling the chat section, instead of hiding
*/
javascript: (function() {
document.getElementById('rightCol').style.display = 'none';
document.getElementById('leftCol').style.display = 'none';
document.getElementById('pageFooter').style.display = 'none';
document.getElementById('globalContainer').style.width = '80%';
document.getElementById('contentCol').style.margin = 0;
document.getElementById('contentArea').style.width = '100%';
document.getElementById('contentCol').style.border = 'none';
document.getElementById('mainContainer').style.border = 'none';
window.setInterval(function() {
all = document.getElementsByClassName('uiStreamStory');
for (i = 0, max = all.length; i < max; i++) {
if (all[i].getAttribute('data-ft').length > 100) {
all[i].style.display = 'none';
}
};
}, 1000);
if (!document.getElementsByClassName("fbChatSidebar hidden_elem").length) {
Chat.toggleSidebar()
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment