Greasy Fork is available in English.

Ephere performance value fix

Corrige como se visualizan los valores de performance del jugador

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

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