Skip to content

Instantly share code, notes, and snippets.

@jaukia
Last active November 23, 2016 13:41
Show Gist options
  • Save jaukia/beb792388251a8927b1ac56c3148fe56 to your computer and use it in GitHub Desktop.
Save jaukia/beb792388251a8927b1ac56c3148fe56 to your computer and use it in GitHub Desktop.
User script for hiding all posts with links from Facebook newsfeed
// ==UserScript==
// @name Style FB feed
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://www.facebook.com/*
// @exclude *://www.facebook.com/plugins/*
// @exclude *://www.facebook.com/ajax/*
// @exclude *://www.facebook.com/xti.php*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
var isRun = false;
function init() {
if(isRun) return;
isRun = true;
// removes borders on fb posts, both empty and non-empty ones
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML =
'._4-u2 { border: 0px !important; }'+
'.home #rightCol, .home #pagelet_sidebar { display: none !important; }'+
'.home #contentArea { width: 611px !important; }'+
'html.sidebarMode .home #contentArea { width: 800px !important; }'+
'.home * { border-radius: 0 !important; border: 0!important; transition: opacity 0.5s ease-in-out; }'+
'._5p3y ._5pbw, ._5p3y ._5pbx, ._5p3y ._5pbx span.text_exposed_link { font-family: sans-serif !important; font-size: 17px !important; font-weight: 400; font-style: normal !important; }'+
'._4f7n, ._4f7n:after, ._4jy0 { background-image: none!important; }'+
'div._fmc { opacity: 0.5; }'+
'#leftCol, #rightCol { opacity: 0.0; }'+
'#leftCol:hover, #rightCol:hover, div._fmc:hover { opacity: 1.0 }';
document.getElementsByTagName('head')[0].appendChild(style);
}
init();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment