Toggle Sidebar

Hides the dang side bar

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Toggle Sidebar
// @namespace    http://tampermonkey.net/
// @version      2024-12-10
// @description  Hides the dang side bar
// @author       mdawe
// @match        https://oldschool.runescape.wiki/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=runescape.wiki
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    const toggleSideBar = () => {
      if (document.getElementById("mw-panel").style.display === "none") {
        document.getElementById("content").style.marginLeft = "11em";
        document.getElementById("mw-panel").style.display = "block";
      } else {
        document.getElementById("mw-panel").style.display = "none";
        document.getElementById("content").style.marginLeft = "0px";
      }
    };

    const button = document.createElement("button");
    button.addEventListener('click', toggleSideBar);
    button.appendChild(document.createTextNode("Toggle Sidebar"));
    button.style.cssText = "border:none;margin-top:3.1em;height:40px;padding:0 0.75em;font-size:0.8125em;"
    document.getElementById("mw-head").prepend(button);
})();