Skip to content

Instantly share code, notes, and snippets.

@neighthan
Last active June 21, 2018 18:54
Show Gist options
  • Save neighthan/2ecea8746b7e9b2c277c4a7d15232397 to your computer and use it in GitHub Desktop.
Save neighthan/2ecea8746b7e9b2c277c4a7d15232397 to your computer and use it in GitHub Desktop.
// ==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