From 8ce80b4fc8cfc612bb6301484fd933f9e6dafcce Mon Sep 17 00:00:00 2001 From: chylex <contact@chylex.com> Date: Sun, 10 Jun 2018 16:42:32 +0200 Subject: [PATCH] Add 'Wholesome Reddit' --- Reddit/WholesomeReddit.user.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Reddit/WholesomeReddit.user.js diff --git a/Reddit/WholesomeReddit.user.js b/Reddit/WholesomeReddit.user.js new file mode 100644 index 0000000..0d739ea --- /dev/null +++ b/Reddit/WholesomeReddit.user.js @@ -0,0 +1,34 @@ +// ==UserScript== +// @name Wholesome Reddit +// @description Hides the downvote button, and forces the upvote button to be always visible. +// @version 1 +// @license MPL-2.0 +// @namespace https://chylex.com +// @homepageURL https://github.com/chylex/Userscripts +// @supportURL https://github.com/chylex/Userscripts/issues +// @include https://*.reddit.com +// @include https://*.reddit.com/* +// @run-at document-start +// @grant none +// ==/UserScript== + +var style = ` +body:not(:lang(np)) .arrow.up { + visibility: visible !important; + pointer-events: auto !important; +} + +body:not(:lang(np)) .arrow.down { + visibility: hidden !important; +}`; + +function inject(){ + if (document.head && document.body){ + document.head.insertAdjacentHTML("beforeend", `<style type="text/css" id="wholesome-reddit">${style}</style>`); + } + else{ + window.setTimeout(inject, 50); + } +}; + +inject();