Skip to content

Instantly share code, notes, and snippets.

@kriskhaira
Last active May 6, 2018 23:02
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 kriskhaira/231b8560168fed899a97 to your computer and use it in GitHub Desktop.
Save kriskhaira/231b8560168fed899a97 to your computer and use it in GitHub Desktop.
Hide Facebook Stream - Tampemonkey Script
// ==UserScript==
// @name Hide Facebook Stream
// @namespace https://gist.github.com/kriskhaira/231b8560168fed899a97
// @version 0.2.0
// @description -
// @author kriskhaira
// @match https://*.facebook.com
// @match https://*.facebook.com/?*
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==
// Makes events invisible
function makeInvisible(jNode) {
console.log("Hiding element");
jNode.css('visibility', 'hidden');
}
// Adds reminder note
function addReminders() {
console.log("Adding reminders");
var msg = "It is not the daily increase, <br> but the daily decrease.";
var msgCss = "font-size:2em; color: #666; text-align: center;";
$reminderTarget = $("#pagelet_composer");
$(`<p style="${msgCss}">"${msg}"</p>`).insertAfter($reminderTarget);
}
function hideStream() {
waitForKeyElements('[id^="topnews_main_stream_"]', makeInvisible);
}
function addRemindersAndHideStream() {
// Adds reminders before hiding stream (required)
addReminders();
hideStream();
}
function init() {
waitForKeyElements('#pagelet_rhc_footer', addRemindersAndHideStream);
}
init();
@kriskhaira
Copy link
Author

kriskhaira commented Jun 7, 2015

Install/Update

  1. Install Tampermonkey in Chrome
  2. Open the RAW version of this gist

Changelog

0.2.x

0.2.0 (2018-05-07)

  • Add quote

0.1.x

0.1.2

  • Fixed an issue where Facebook would keep trying to refresh the page and load the news feed

0.1.1

  • Match only homepage URLs

0.1.0

  • Initial version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment