Cold Network Questions

Hides the Hot Network Questions sidebar on Stack Exchange and Stack Overflow; it's just so distracting!

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        Cold Network Questions
// @namespace   kunaifirestuff
// @description Hides the Hot Network Questions sidebar on Stack Exchange and Stack Overflow; it's just so distracting!
// @include     *
// @version     4
// @grant       none
// ==/UserScript==

// If the document contains an element with the id "hot-network-questions",
// and this element has a child which has a child which is a link
// the url of which contains "stackoverflow.com", then we are sure this
// is a stackexchange site.
// Is it too redundant? Probably.

var hot = document.getElementById("hot-network-questions");
var isItStackexchange = false;

Loopy:
for(var i = 0; i < hot.children.length; i++){
  if(hot.children[i].children.length > 0 && hot.children[i].children[0].tagName == "A"){
    if(hot.children[i].children[0].href.indexOf("stackexchange.com") > -1){
      isItStackexchange = true;
      break Loopy;
    }
  }
}

if(isItStackexchange){
  hot.outerHTML = "";
}