Bonk.io Snow Disabler

Disable snow on bonk.io!

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name         Bonk.io Snow Disabler
// @namespace    http://pixelmelt.dev/
// @version      0.1
// @description  Disable snow on bonk.io!
// @author       Pix#7008
// @match        https://bonk.io/gameframe-release.html
// @grant        none
// @run-at       document-start
// @license MIT
// ==/UserScript==

const injectorName = `Snow Disabler`;
const errorMsg = `Whoops! ${injectorName} was unable to load.
This may be due to an update to Bonk.io. If so, please report this error!
This could also be because you have an extension that is incompatible with \
${injectorName}`;

function injector(bonkSrc){
    let snow = /(\[\d+\]\(\w+\[\d+\]\[\d+\]\);this\[\w+\[\d+\]\[\d+\]\])=false;/
    console.log("Warming up...");
    let newBonkSrc = bonkSrc.replace(snow, "$1=true;")
    if(bonkSrc === newBonkSrc) throw "Injection failed!";
    console.log(injectorName+" injector run");
    return newBonkSrc;
}

if(!window.bonkCodeInjectors) window.bonkCodeInjectors = [];
window.bonkCodeInjectors.push(bonkCode => {
    try {
        return injector(bonkCode);
    } catch (error) {
        alert(errorMsg);
        throw error;
    }
});