modler

Oneclick-like installer for Beat Saber mods from github.

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        modler 
// @namespace   https://github.com/StormPacer/Modler
// @include     https://github.com/*/*
// @version     0.1
// @author      StormPacer
// @license     MIT
// @description Oneclick-like installer for Beat Saber mods from github.
// ==/UserScript==

(function () {
    "use strict";

    const list = document.getElementsByClassName("file-navigation mb-3 d-flex flex-items-start");

    const element = document.createElement("button");
    element.classList.add("btn");
    const txt = document.createTextNode("🛠 Install mod");

    const urlParts = window.location.href.split("/");

    element.onclick = () => {
        window.location.replace(`modler://https://api.github.com/repos/${urlParts[3]}/${urlParts[4]}/releases/latest`);
    };

    element.appendChild(txt);

    list.item(0).appendChild(element);
})();