Don't Read Below the Line

Script intended to reduce misanthropic feelings, by hiding the comments section on some UK newspapers.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Don't Read Below the Line
// @namespace   http://xyxyx.org/
// @include     http://www.theguardian.com/*
// @include     https://www.theguardian.com/*
// @include     http://www.dailymail.co.uk/*
// @include     https://www.dailymail.co.uk/*
// @version     0.3
// @grant       none
// @description Script intended to reduce misanthropic feelings, by hiding the comments section on some UK newspapers.
// ==/UserScript==

console.log("Trying to hide comments");

var hideIfFound = function(element) {
	if (!element) {
		console.log("Not found");
	} else {
		console.log("Hiding");
		element.style.visibility = 'hidden';
	}
}

// Gaurdian
hideIfFound(document.getElementById("comments"));
hideIfFound(document.getElementById("top-comments"));
hideIfFound(document.getElementById("d2-root"));

// Daily Mail
hideIfFound(document.getElementById("reader-comments"));