aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc/old-reddit-page-cleanup.js33
1 files changed, 33 insertions, 0 deletions
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)
+})