Roblox Performance Booster for Chromebook

Reduces lag and improves FPS on Roblox by optimizing graphics settings, memory usage, and performance

Size

11.5 KB

Version

1.1.1

Created

Feb 27, 2026

Updated

about 2 months ago

1// ==UserScript==
2// @name		Roblox Performance Booster for Chromebook
3// @description		Reduces lag and improves FPS on Roblox by optimizing graphics settings, memory usage, and performance
4// @version		1.1.1
5// @match		https://www.roblox.com/*
6// @match		https://web.roblox.com/*
7// ==/UserScript==
8(function() {
9    'use strict';
10
11    console.log('Roblox Performance Booster: Initializing...');
12
13    // Performance optimization settings
14    const performanceSettings = {
15        reduceGraphics: true,
16        optimizeMemory: true,
17        boostFPS: true,
18        disableParticles: true,
19        reduceShadows: true,
20        lowerTextureQuality: true
21    };
22
23    // Debounce function to prevent excessive calls
24    function debounce(func, wait) {
25        let timeout;
26        return function executedFunction(...args) {
27            const later = () => {
28                clearTimeout(timeout);
29                func(...args);
30            };
31            clearTimeout(timeout);
32            timeout = setTimeout(later, wait);
33        };
34    }
35
36    // Apply performance optimizations to Roblox game
37    function applyPerformanceOptimizations() {
38        console.log('Roblox Performance Booster: Applying optimizations...');
39
40        try {
41            // Optimize WebGL settings for better performance
42            const canvas = document.querySelector('canvas');
43            if (canvas) {
44                console.log('Roblox Performance Booster: Canvas found, optimizing WebGL...');
45                
46                // Get WebGL context and optimize
47                const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
48                if (gl) {
49                    // Disable antialiasing for better performance
50                    gl.disable(gl.BLEND);
51                    gl.disable(gl.DEPTH_TEST);
52                    console.log('Roblox Performance Booster: WebGL optimizations applied');
53                }
54
55                // Reduce canvas resolution for better FPS
56                if (performanceSettings.boostFPS) {
57                    canvas.style.imageRendering = 'pixelated';
58                    console.log('Roblox Performance Booster: Canvas resolution optimized');
59                }
60            }
61
62            // Inject CSS to hide unnecessary visual elements
63            if (performanceSettings.reduceGraphics) {
64                TM_addStyle(`
65                    /* Reduce visual effects */
66                    * {
67                        text-shadow: none !important;
68                        box-shadow: none !important;
69                    }
70                    
71                    /* Optimize animations */
72                    * {
73                        animation-duration: 0.1s !important;
74                        transition-duration: 0.1s !important;
75                    }
76                    
77                    /* Hide non-essential elements */
78                    .rbx-particles,
79                    .particle-effect,
80                    [class*="particle"],
81                    [class*="effect"] {
82                        display: none !important;
83                    }
84                `);
85                console.log('Roblox Performance Booster: Visual optimizations applied');
86            }
87
88            // Memory optimization - clear caches periodically
89            if (performanceSettings.optimizeMemory) {
90                setInterval(() => {
91                    // Force garbage collection by clearing unused objects
92                    if (window.gc) {
93                        window.gc();
94                    }
95                    console.log('Roblox Performance Booster: Memory optimization cycle completed');
96                }, 60000); // Every 60 seconds
97            }
98
99            // Optimize Roblox settings via localStorage
100            optimizeRobloxSettings();
101
102        } catch (error) {
103            console.error('Roblox Performance Booster: Error applying optimizations:', error);
104        }
105    }
106
107    // Optimize Roblox settings stored in localStorage
108    function optimizeRobloxSettings() {
109        try {
110            // Set graphics quality to lowest for best performance
111            const graphicsSettings = {
112                'SavedQualityLevel': '1', // Lowest quality
113                'GraphicsQualityLevel': '1',
114                'MasterVolume': '0.5',
115                'RenderShadows': 'false',
116                'RenderParticles': 'false'
117            };
118
119            for (const [key, value] of Object.entries(graphicsSettings)) {
120                localStorage.setItem(key, value);
121            }
122
123            console.log('Roblox Performance Booster: Roblox settings optimized');
124        } catch (error) {
125            console.error('Roblox Performance Booster: Error optimizing settings:', error);
126        }
127    }
128
129    // Create performance control panel
130    function createControlPanel() {
131        const panel = document.createElement('div');
132        panel.id = 'roblox-perf-panel';
133        panel.innerHTML = `
134            <div style="position: fixed; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.9); color: white; padding: 15px; border-radius: 10px; z-index: 999999; font-family: Arial, sans-serif; min-width: 250px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);">
135                <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
136                    <h3 style="margin: 0; font-size: 14px; color: #00ff00;">⚡ Performance Booster</h3>
137                    <button id="perf-toggle-btn" style="background: #ff4444; border: none; color: white; padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: 12px;">Hide</button>
138                </div>
139                <div id="perf-content">
140                    <div style="margin-bottom: 10px;">
141                        <label style="display: flex; align-items: center; cursor: pointer; font-size: 12px;">
142                            <input type="checkbox" id="reduce-graphics" checked style="margin-right: 8px;">
143                            <span>Reduce Graphics</span>
144                        </label>
145                    </div>
146                    <div style="margin-bottom: 10px;">
147                        <label style="display: flex; align-items: center; cursor: pointer; font-size: 12px;">
148                            <input type="checkbox" id="optimize-memory" checked style="margin-right: 8px;">
149                            <span>Optimize Memory</span>
150                        </label>
151                    </div>
152                    <div style="margin-bottom: 10px;">
153                        <label style="display: flex; align-items: center; cursor: pointer; font-size: 12px;">
154                            <input type="checkbox" id="boost-fps" checked style="margin-right: 8px;">
155                            <span>Boost FPS</span>
156                        </label>
157                    </div>
158                    <div style="margin-bottom: 10px;">
159                        <label style="display: flex; align-items: center; cursor: pointer; font-size: 12px;">
160                            <input type="checkbox" id="disable-particles" checked style="margin-right: 8px;">
161                            <span>Disable Particles</span>
162                        </label>
163                    </div>
164                    <button id="apply-settings-btn" style="width: 100%; background: #00ff00; border: none; color: black; padding: 8px; border-radius: 5px; cursor: pointer; font-weight: bold; font-size: 12px; margin-top: 10px;">Apply Settings</button>
165                    <div id="fps-counter" style="margin-top: 10px; padding: 8px; background: rgba(0, 255, 0, 0.1); border-radius: 5px; text-align: center; font-size: 12px;">
166                        FPS: <span id="fps-value">--</span>
167                    </div>
168                </div>
169            </div>
170        `;
171
172        document.body.appendChild(panel);
173
174        // Toggle panel visibility
175        const toggleBtn = document.getElementById('perf-toggle-btn');
176        const content = document.getElementById('perf-content');
177        let isVisible = true;
178
179        toggleBtn.addEventListener('click', () => {
180            isVisible = !isVisible;
181            content.style.display = isVisible ? 'block' : 'none';
182            toggleBtn.textContent = isVisible ? 'Hide' : 'Show';
183        });
184
185        // Apply settings button
186        document.getElementById('apply-settings-btn').addEventListener('click', () => {
187            performanceSettings.reduceGraphics = document.getElementById('reduce-graphics').checked;
188            performanceSettings.optimizeMemory = document.getElementById('optimize-memory').checked;
189            performanceSettings.boostFPS = document.getElementById('boost-fps').checked;
190            performanceSettings.disableParticles = document.getElementById('disable-particles').checked;
191
192            applyPerformanceOptimizations();
193            
194            // Show confirmation
195            const btn = document.getElementById('apply-settings-btn');
196            btn.textContent = '✓ Applied!';
197            btn.style.background = '#00aa00';
198            setTimeout(() => {
199                btn.textContent = 'Apply Settings';
200                btn.style.background = '#00ff00';
201            }, 2000);
202        });
203
204        // FPS Counter
205        let lastTime = performance.now();
206        let frames = 0;
207        
208        function updateFPS() {
209            frames++;
210            const currentTime = performance.now();
211            
212            if (currentTime >= lastTime + 1000) {
213                const fps = Math.round((frames * 1000) / (currentTime - lastTime));
214                document.getElementById('fps-value').textContent = fps;
215                frames = 0;
216                lastTime = currentTime;
217            }
218            
219            requestAnimationFrame(updateFPS);
220        }
221        
222        updateFPS();
223
224        console.log('Roblox Performance Booster: Control panel created');
225    }
226
227    // Wait for page to load and Roblox game to initialize
228    function waitForRobloxGame() {
229        const checkInterval = setInterval(() => {
230            const canvas = document.querySelector('canvas');
231            if (canvas) {
232                console.log('Roblox Performance Booster: Roblox game detected');
233                clearInterval(checkInterval);
234                applyPerformanceOptimizations();
235            }
236        }, 1000);
237
238        // Stop checking after 30 seconds
239        setTimeout(() => {
240            clearInterval(checkInterval);
241        }, 30000);
242    }
243
244    // Initialize the extension
245    function init() {
246        console.log('Roblox Performance Booster: Starting initialization...');
247
248        // Create control panel immediately
249        if (document.body) {
250            createControlPanel();
251        } else {
252            TM_runBody(() => {
253                createControlPanel();
254            });
255        }
256
257        // Apply initial optimizations
258        applyPerformanceOptimizations();
259
260        // Wait for Roblox game to load
261        waitForRobloxGame();
262
263        // Monitor for new canvas elements (game restarts)
264        const observer = new MutationObserver(debounce(() => {
265            const canvas = document.querySelector('canvas');
266            if (canvas && !canvas.dataset.optimized) {
267                canvas.dataset.optimized = 'true';
268                applyPerformanceOptimizations();
269            }
270        }, 1000));
271
272        observer.observe(document.body, {
273            childList: true,
274            subtree: true
275        });
276
277        console.log('Roblox Performance Booster: Initialization complete!');
278    }
279
280    // Start the extension
281    if (document.readyState === 'loading') {
282        document.addEventListener('DOMContentLoaded', init);
283    } else {
284        init();
285    }
286
287})();