Ephere performance value fix

Corrige como se visualizan los valores de performance del jugador

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.

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

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         Ephere performance value fix
// @namespace    https://greasyfork.org/en/users/13275
// @version      1.1
// @description  Corrige como se visualizan los valores de performance del jugador
// @author       AFX Prodigy
// @match        *://play.ephere.football/ephereal/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=http://play.ephere.football
// @grant        none
// @license      MIT
// ==/UserScript==

waitForElm('.css-1rzb73m').then((elm) => {
    console.log('Datos encontrados.');
    setTimeout(() => { NumFix(); }, 2000);
});


function NumFix(){
    var rws = document.querySelectorAll('[aria-colindex="16"]')
    var rwsN = rws.length

    if (rwsN == 0){
        rws = document.querySelectorAll('[aria-colindex="10"]')
        rwsN = rws.length
    }
    for (let i = 0; i < rwsN; i++) {
        const Nfix = parseFloat(rws[i].getElementsByClassName('css-1rzb73m')[0].innerText).toPrecision(2)
        rws[i].getElementsByClassName('css-1rzb73m')[0].innerText = Nfix
    }
}

function waitForElm(selector) {
    return new Promise(resolve => {
        if (document.querySelector(selector)) {
            return resolve(document.querySelector(selector));
        }

        const observer = new MutationObserver(mutations => {
            if (document.querySelector(selector)) {
                resolve(document.querySelector(selector));
                observer.disconnect();
            }
        });

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