From 1299cc3ad20614e6396e71af75b6d19c08567aff Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Tue, 5 Nov 2024 09:32:02 -0600 Subject: add old reddit page cleanup script --- misc/old-reddit-page-cleanup.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 misc/old-reddit-page-cleanup.js (limited to 'misc') diff --git a/misc/old-reddit-page-cleanup.js b/misc/old-reddit-page-cleanup.js new file mode 100644 index 0000000..9326744 --- /dev/null +++ b/misc/old-reddit-page-cleanup.js @@ -0,0 +1,33 @@ +// ==UserScript== +// @name old.reddit.com page cleanup +// @namespace Violentmonkey Scripts +// @match https://old.reddit.com/* +// @grant none +// @version 1.0 +// @author tjkeller.xyz +// @description 10/20/2024, 7:22:44 PM +// ==/UserScript== + +/* remove top welcome banner */ +document.querySelector("section").remove() + +/* remove login prompt above comments */ +document.querySelector("section").remove() + +/* remove user sidebar */ +document.body.parentElement.style.paddingRight = 0 +document.getElementById("header-bottom-right").remove() + +/* remove most of the sidebar */ +const sidebar = document.querySelector("div.side") +console.log(sidebar) +sidebar.style.float = "none" +sidebar.style.margin = "25px" +while (sidebar.children[1]) + sidebar.children[1].remove() + +/* wrap code in pre instead of p */ +document.querySelectorAll("code").forEach(c => { + const pre = c.parentElement.parentElement.insertBefore(document.createElement("pre"), c.parentElement) + pre.appendChild(c) +}) -- cgit v1.2.3