Last active
May 10, 2022 17:31
-
-
Save SeanMcP/01f01a9a88e68a25cf6572745125113e to your computer and use it in GitHub Desktop.
Changes to improve my experience on Reddit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Reddit Tweaks | |
// @namespace https://seanmcp.com | |
// @version 0.1.1 | |
// @description Changes to improve my experience on Reddit | |
// @author SeanMcP | |
// @match https://www.reddit.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const selectors = ['a[href*="/r/all/"]', 'a[href*="/r/popular/"]'] | |
const prohibited = ['/', '/r/all/', '/r/popular/'] | |
const pathname = window.location.pathname | |
if (prohibited.includes(window.location.pathname)) { | |
selectors.push('#AppRouter-main-content') | |
} | |
const style = document.createElement('style') | |
style.innerText = ` | |
/* STYlES ADDED BY USERSCRIPT */ | |
${selectors.join(',')} { | |
display: none !important; | |
} | |
` | |
document.head.appendChild(style) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment