Web CPU Tamer

𝖢𝖸 𝖥𝗎𝗇𝗀
2025-04-05T04:33:18Z

Reduce Browser's Energy Impact via implicit async scheduling delay

🌿 Web CPU Tamer

Reduce your browser’s CPU usage and energy consumption by adding subtle, smart delays to JavaScript scheduling — frame-aligned, silent, and effective.

📌 What does this userscript do?

Web CPU Tamer is a lightweight performance and energy optimization script. It works by inserting tiny, precisely-timed async delays before JavaScript tasks run — giving your browser room to render, cool down, and breathe.

Websites often queue up lots of timers and animation loops that compete with rendering, input, and other system tasks. This script gently slows down how frequently those scripts run, improving overall efficiency — without breaking website functionality.

🚀 Highlights

🧠 Frame-aligned scheduling delays

The script enhances:

setTimeout

setInterval

requestAnimationFrame

Each scheduled task is wrapped with two async deferrals, using:

queueMicrotask — to yield within the JS task queue

MutationObserver — to wait until the next browser rendering cycle

This creates a render-aware delay, ensuring the browser gets time to layout, paint, or cool the CPU before heavy scripts resume.

🤫 Stealth-compatible timing

The script adds a tiny offset to timeout delays to evade detection or interference by:

Brave Browser (privacy patches)

uBlock Origin (stealth scripts)

Chrome’s heuristic throttling

This ensures the delays remain effective and invisible.

🛡️ Safe error handling

All async task wrappers isolate exceptions and safely re-throw them in the next microtask. This avoids silent failures and maintains helpful stack traces for debugging.

🧱 Clean modular design

Shared async logic is extracted into reusable helpers. Cancellation tracking is handled cleanly with Sets for setTimeout, setInterval, and requestAnimationFrame.

✅ Key Features

⚡ Reduces CPU wakeups and JS over-scheduling

🔋 Helps extend battery life on laptops and mobile

💻 Improves responsiveness under load

🤫 Bypasses Brave/uBlock/heuristic interference

📦 Uses only native APIs (no timers, no blocking)

🛑 Respects cancellation of scheduled tasks

🧩 Does NOT modify webpage content or logic

🔐 Safe, clean, and dependency-free

❌ What it doesn’t do

❌ It doesn’t block ads or trackers

❌ It doesn’t alter visuals, DOM, or network requests

❌ It doesn’t interfere with page layout, styles, or scripts

✅ It simply adjusts when tasks run — not how

🌐 Where it runs

The script runs automatically on all standard webpages:

http://*/*
https://*/*

It is excluded from direct links to:

.txt, .png, .jpg, .jpeg, .gif, .xml, .svg, .manifest, .log, .ini

So image viewers, text files, and static file URLs are unaffected.

🧪 Browser Compatibility

Browser | Status
Chrome / Chromium | ✅ Fully supported
Firefox | ✅ Fully supported
Brave | ✅ Works reliably (YouTube-safe as well)
Edge | ✅ Fully supported
Safari | ⚠️ Works, but mutation timing may vary slightly

Also works with:

✅ Tampermonkey (page context)

✅ Violentmonkey (page/content context)

✅ Firemonkey (content context)

⚠️ Stay (page context, incompatible with pages that have CSP restrictions)

🔐 Security & Privacy

🧠 No trackers, telemetry, or fingerprinting

🔒 No remote requests or hidden analytics

💡 Uses only local, inspectable logic

📜 Open source under the MIT License

🧙 Author

CY Fung
🔗 GitHub Support Page

🧾 License

MIT License
Use, modify, or redistribute freely.