Dashboard auto-refresh

Automatically refresh your Multi-Player dashboard by re-applying your currently selected games filter.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

Advertisement:

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Advertisement:

// ==UserScript==
// @name         Dashboard auto-refresh
// @namespace    http://tampermonkey.net/
// @version      2026-04-17
// @description  Automatically refresh your Multi-Player dashboard by re-applying your currently selected games filter.
// @author       JK_3
// @match        https://war.app/*ulti*layer/
// @icon         https://icons.duckduckgo.com/ip2/war.app.ico
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const secondsBetweenRefreshes = 30;

    function ScheduleRefresh() {
            setTimeout(RefreshFilter, secondsBetweenRefreshes * 1000);
    }

    function GetFilterPrompt() {
        return document.getElementById("AlertVMPrompt_Inner");
    }

    function RefreshFilter()
    {
        function SelectFilterOption(filterText) {
            let prompt = GetFilterPrompt();
            if (prompt) {
                let btn = Array.from(prompt.querySelectorAll("input")).filter(i => i.value.startsWith(filterText)).at(0);
                setTimeout(() => btn.click(), 300); // WZ is slow when adding event handlers, so we need to wait with clicking
                ScheduleRefresh();
            } else {
                setTimeout(() => SelectFilterOption(filterText), 25);
            }
        }

        let filterBtn = document.getElementById("MyGamesFilterBtn");
        if (filterBtn) {
            if (!GetFilterPrompt()) {
                filterBtn.click();
            }

            SelectFilterOption(filterBtn.innerText.slice(8, -3));
        }
    }

    ScheduleRefresh();
})();