Don't mess with my "use subreddit style" toggle (Old Reddit/RES required)

This script always shows RES' "use subreddit style" checkbox in the right of the logout link even if the sub intentionally hides it from the side bar (need RES extension installed)

// ==UserScript==
// @name        Don't mess with my "use subreddit style" toggle (Old Reddit/RES required)
// @author      warireku
// @description This script always shows RES' "use subreddit style" checkbox in the right of the logout link even if the sub intentionally hides it from the side bar (need RES extension installed)
// @include     https://old.reddit.com/r/*
// @license     CC0 1.0 Universal (No Rights Reserved)
// @version     0.1
// @grant       none
// @namespace https://gf.qytechs.cn/users/237709
// ==/UserScript==

//runs when page is fully loaded
window.addEventListener('load', function() {
    var styleBox = document.getElementById("res-style-checkbox");
    //if the res element exists
    if(styleBox !== null){
      styleBox.style.cssText = "display:inline !important; visibility: visible !important";

      var styleForm = document.getElementsByClassName("res-sr-style-toggle");
      var separator = document.getElementsByClassName("separator")[0];
      separator.innerHTML = "|";
      for(var i=0;i<styleForm.length;i++){
        styleForm[i].style.cssText = "display:contents !important; visibility: visible !important; position:absolute !important;";
        document.getElementById("header-bottom-right").appendChild(separator);
        document.getElementById("header-bottom-right").appendChild(styleForm[i]);
      }
		}
}, false);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址