Last active
June 21, 2018 18:54
-
-
Save neighthan/2ecea8746b7e9b2c277c4a7d15232397 to your computer and use it in GitHub Desktop.
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 Focused StackExchanges | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Remove distracting things (hot network questions) from StackExchange pages | |
// @author Nathan Hunt | |
// @match https://stackoverflow.com/* | |
// @match https://*.stackexchange.com/* | |
// @match https://superuser.com | |
// @grant none | |
// ==/UserScript== | |
// GitHub gist link: https://gist.github.com/neighthan/2ecea8746b7e9b2c277c4a7d15232397 | |
(function() { | |
'use strict' | |
let delay = 1000 | |
let waitAndHide = function(id) { | |
setTimeout(function () { | |
let element = document.getElementById(id) | |
console.log(`Trying to hide ${id} (${element}).`) | |
if (element) { | |
element.style.display = 'none' | |
} else { | |
waitAndHide(id) | |
} | |
}, delay) | |
} | |
waitAndHide('hot-network-questions') | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment