Revert "Charts" Update

Killing Charts on Roblox

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Revert "Charts" Update
// @namespace    http://tampermonkey.net/
// @version      3.141592653589793238462643383279502884197169399375105820974944592307816406286
// @description  Killing Charts on Roblox
// @match        https://www.roblox.com/*
// @run-at       document-start
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function transform() {

        if (document.title.includes('Charts - Roblox')) {
            document.title = document.title.replace('Charts - Roblox', 'Discover - Roblox');
        }
// 0.4!! js a lil extra! manipulates the browser history 😈😈 ooo and takes all your cookies cause big scary words "manipulate"!!!
                if (window.location.pathname.startsWith('/charts')) {
            const newUrl = window.location.href.replace('/charts', '/discover');
            window.history.replaceState(null, '', newUrl);
        }
// transform is just, yk, the transforming part

        function updatedoc() {
            const navMenuItem = document.querySelector('a.nav-menu-title[href="/charts"]');
            if (navMenuItem) {
                navMenuItem.textContent = 'Discover';
            }
            // update doc is js updating the DOM (document object model)

            const h1Element = document.querySelector('h1');
            if (h1Element && h1Element.textContent === 'Charts') {
                h1Element.textContent = 'Discover';
            }
        }


        updatedoc();
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', updatedoc);
        }
    }
// bam!
    transform();

console.log(":steamhappy:")
    //observer shit for faster script load! (totally not ripped from stackoverflow because i searched how to make a script run before a webpage!)
    const observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
            if (mutation.type === 'childList' || mutation.type === 'attributes') {
                transform();
            }
        });
    });

    function onpageload() {
        if (document.body) {
            observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['title'] });
        } else {
            setTimeout(onpageload, 10);
        }
    }
    onpageload();
    // makes the code load as soon as the page runs so there isnt any split second "Charts" around, uses observer shit to get the document asap basically idk how else to explain it
})();