Greasy Fork is available in English.
Roblox Home Page Cleaner with the option to toggle on or off "Today's Picks", previously known as Roblox Recommended, Sponsored and Events remover, also removes the add friends button!
当前为
// ==UserScript==
// @name Roblox Home Cleaner
// @namespace Roblox Recommended and Sponsored remover
// @version 6.1.2
// @description Roblox Home Page Cleaner with the option to toggle on or off "Today's Picks", previously known as Roblox Recommended, Sponsored and Events remover, also removes the add friends button!
// @author Krex
// @match https://*.roblox.com/home
// @grant GM_addStyle
// ==/UserScript==
(function () {
'use strict';
const ALLOWED_SECTIONS = ["Continue", "Favorites"];
let showTodaysPicks = false;
function addNavBarButton() {
const navBar = document.querySelector('.navbar, .rbx-navbar');
if (!navBar) return;
const navBarItems = navBar.querySelector('.navbar-right') || navBar;
const toggleButton = document.createElement('a');
toggleButton.textContent = 'Toggle Today\'s Picks';
Object.assign(toggleButton.style, {
userSelect: 'none',
padding: '6px 9px',
display: 'inline-block',
color: '#fff',
fontSize: '14px',
textDecoration: 'none',
cursor: 'pointer',
textAlign: 'center',
position: 'relative',
});
GM_addStyle(`
a::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
right: 50%;
height: 2px;
background-color: transparent;
transition: all 0.3s ease;
}
a:hover::after {
left: 0;
right: 0;
background-color: #fff;
}
`);
toggleButton.addEventListener('click', () => {
showTodaysPicks = !showTodaysPicks;
cleanHomePage();
});
navBarItems.appendChild(toggleButton);
}
function cleanHomePage() {
const friendsTile = document.querySelector('.friends-carousel-list-container > div.friends-carousel-tile:nth-of-type(1) > [href*="/users/friends"]');
if (friendsTile && friendsTile.parentElement) {
friendsTile.parentElement.remove();
} //will this work????? hmmmmmmmmmm
document.querySelectorAll('h2, h3').forEach(heading => {
const sectionTitle = heading.textContent.trim();
const container = heading.closest(
'div[class*="game-sort-carousel-wrapper"], div[data-testid="home-page-game-grid"]'
);
if (container) {
container.style.display =
ALLOWED_SECTIONS.includes(sectionTitle) ||
(showTodaysPicks && sectionTitle.startsWith("Today's Picks"))
? ''
: 'none';
}
});
}
const observer = new MutationObserver(cleanHomePage);
observer.observe(document.body, { childList: true, subtree: true });
addNavBarButton();
cleanHomePage();
})();