Sltrooms Enable Uploads

8/2/2025, 1:53:46 PM

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

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

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        Sltrooms Enable Uploads
// @namespace   Violentmonkey Scripts
// @match       *://sltrooms.cc/r/*
// @grant       none
// @version     1.0
// @author      SenorCompost
// @description 8/2/2025, 1:53:46 PM
// @license MIT
// ==/UserScript==


waitForElement("button[class='btn btn-success btn-icon upload_new_files_to_room']").then((element) => {
 enableUploads();
});


function enableUploads(){
  MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
      var myobserver = new MutationObserver(mutations => {
        var element = document.querySelector("button[class='btn btn-success btn-icon upload_new_files_to_room']");
        if(element && element.style.display == 'none'){
          element.removeAttribute('style');
        }
      });

    myobserver.observe(document, {
        childList: true,
        subtree: true,
        attributes: true
  });
}

function waitForElement(selector) {
    return new Promise((resolve) => {
        var observer = new MutationObserver((mutations, observer) => {
            var element = document.querySelector(selector);
            if (element) {
                observer.disconnect();
                resolve(element);
            }
        });

        observer.observe(document, {
            childList: true,
            subtree: true,
            attributes: true
        });
    });
}