Skip to content

Instantly share code, notes, and snippets.

@SeanMcP
Last active May 10, 2022 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanMcP/01f01a9a88e68a25cf6572745125113e to your computer and use it in GitHub Desktop.
Save SeanMcP/01f01a9a88e68a25cf6572745125113e to your computer and use it in GitHub Desktop.
Changes to improve my experience on Reddit
// ==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