Last active
May 6, 2018 23:02
-
-
Save kriskhaira/231b8560168fed899a97 to your computer and use it in GitHub Desktop.
Hide Facebook Stream - Tampemonkey Script
This file contains 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 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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install/Update
Changelog
0.2.x
0.2.0 (2018-05-07)
0.1.x
0.1.2
0.1.1
0.1.0