Toggle Sidebar

Hides the dang side bar

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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);
})();