UniteAPI Ranked WR Injector

Show ranked WR on UniteAPI player page

2025-11-17 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         UniteAPI Ranked WR Injector
// @namespace    https://yeehoiimeenoiiii.com
// @license      MIT
// @version      0.3
// @description  Show ranked WR on UniteAPI player page
// @match        https://uniteapi.dev/p/*
// @run-at       document-idle
// @grant        none
// ==/UserScript==
function myFunction() {setTimeout(() => {
    let statsBox = document.querySelector(".sc-504963e2-2.btGQnE");
    let statsBoxContent = statsBox.querySelectorAll("div");
    for (let i = 0; i < statsBoxContent.length; i++) {
        console.log(`${i}: ${statsBoxContent[i].innerText}`);
    }
    console.log(statsBoxContent[3])

    let playerName = document.querySelector(".sc-6d6ea15e-1.gpvunk").innerText;
    let playerStats = document.querySelectorAll(".sc-6d6ea15e-1.sc-10fb34f9-1.SarYu.dzkbmM");
    for (let i = 0; i < playerStats.length; i++) {
        console.log(`${i}: ${playerStats[i].innerText}`);
    }
    let totalBattles = parseFloat(playerStats[2].innerText)
    let numOfWins = parseFloat(playerStats[3].innerText)
    let rankedWr = numOfWins / totalBattles;
    let finalWr = (rankedWr * 100).toFixed(2);
    console.log(`${playerName}'s win rate is ${finalWr}%. They have ${totalBattles} ranked battles.`);
    console.log(playerStats.length);

    statsBoxContent[3].insertAdjacentHTML("afterend",`
    <div class="sc-10fb34f9-0 flAlGE">
        <p id="wrLabel" class="sc-6d6ea15e-3 hxGuyl">
            Ranked Win Rate %
        </p>
        <p id="wrColor" style="color:yellow !important;" class="sc-6d6ea15e-1 sc-10fb34f9-1 SarYu dzkbmM">
            ${finalWr}%
        </p>
    </div>
`);

    let varWrColor = document.getElementById("wrColor")
    let varWrLabel = document.getElementById("wrLabel")


    varWrColor.style.setProperty("color", "#cef33dff", "important");
    varWrLabel.style.setProperty("color", "#cef33dff", "important");
    varWrLabel.style.setProperty("font-weight", "bold");
}, 2000);
}

window.onload = myFunction;