Remove Homepage Garbage

Removes everything from the roblox homepage deemed useless (you'll basically just see your friends, continue section, and favourites)

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Remove Homepage Garbage
// @namespace    https://www.roblox.com/home
// @version      2025.05.11
// @description  Removes everything from the roblox homepage deemed useless (you'll basically just see your friends, continue section, and favourites)
// @author       CMTG (@callmetreeguy on discord)
// @match        https://www.roblox.com/home
// @icon         https://www.google.com/s2/favicons?sz=64&domain=roblox.com
// @grant        none
// @license MIT
// ==/UserScript==


const DontDelete = {
    "Continue": true,
    "Favorites": true
}

function removeRecommendedSection() {
    const allGameGrids = document.querySelectorAll('div[data-testid="home-page-game-grid"]');
    allGameGrids.forEach(GameGrid => GameGrid.remove())

    const allContainers = document.querySelectorAll('div.game-sort-carousel-wrapper');
    //aria-label
    allContainers.forEach(container => {

        const ContainerText = container.querySelector("div.home-sort-header-container > div > *:first-child").getAttribute('aria-label')
        //ty roblox for inculding the aria-label <3
        if (!DontDelete[ContainerText]) {
            container.remove()
        }
    })

}
window.addEventListener('load', removeRecommendedSection);

const observer = new MutationObserver((mutations) => {
    const ContinueAB1 = document.querySelector("h2.sort-header > a")
    const ContinueAB2 = document.querySelector('div[data-testid="section-header"] > a')

    // basically if you are in the old homepage and not in the A/B test roblox will delete the entire game page accidentially

    if ((ContinueAB1 && ContinueAB1.innerText == "Continue") || ContinueAB2){
        setTimeout(removeRecommendedSection, 0)
    }
});

observer.observe(document.body, { childList: true, subtree: true });