Greasy Fork

Greasy Fork is available in English.

Replace lolesports.com Worlds 2024 riotgames channel with caedrel

Earn lolesports rewards/drops while watching a certain ratking. Only works with the Twitch provider.

当前为 2024-10-05 提交的版本,查看 最新版本

// ==UserScript==
// @name         Replace lolesports.com Worlds 2024 riotgames channel with caedrel
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Earn lolesports rewards/drops while watching a certain ratking. Only works with the Twitch provider.
// @author       aureliony
// @match        https://lolesports.com/live/worlds/riotgames
// @icon         https://www.google.com/s2/favicons?sz=64&domain=lolesports.com
// @grant        none
// @license      MIT
// ==/UserScript==

function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

async function replaceSrc() {
    while (true) {
        let iframe = document.querySelector("#video-player-twitch > iframe");
        if (iframe) {
            iframe.src = iframe.src.replace("?channel=riotgames", "?channel=caedrel");
            break;
        }
        await sleep(50);
    }
}

replaceSrc();