Web CPU Tamer

透過隱性非同步排程延遲減少瀏覽器的能源影響

目前為 2025-04-05 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
𝖢𝖸 𝖥𝗎𝗇𝗀
評價
0 0 0
版本
2025.100.3
建立日期
2025-04-05
更新日期
2025-04-05
尺寸
16.4 KB
授權條款
MIT
腳本執行於
所有網站

🌿 Web CPU Tamer

Reduce your browser’s energy usage and CPU load by adding smart, invisible delays to script execution.


📌 What does this userscript do?

Web CPU Tamer introduces a lightweight, intelligent delay into the browser's task scheduling system. By doing so, it prevents web pages from overwhelming your CPU with tightly packed timers and animations — all without breaking any functionality.

This leads to:

  • Lower energy usage 🔋
  • Reduced fan noise 🌀
  • Smoother multitasking 🧠
  • A cooler and more efficient browsing experience 🌡️

💡 How does it work?

This script replaces the browser’s built-in scheduling functions with optimized versions:

Original What it does
setTimeout / setInterval Adds two micro-delays before each execution using queueMicrotask and MutationObserver. This lets the browser handle layout and paint cycles more gracefully.
requestAnimationFrame Adds a subtle delay by measuring the time difference across animation frames and yielding execution until the browser is ready.
clearTimeout / clearInterval / cancelAnimationFrame Fully respected and properly tracked, so cancelling still works perfectly.

Under the hood, these replacements insert a two-stage implicit delay around scheduled tasks — just enough for the browser to breathe without making apps feel sluggish.


✅ Key Features

  • Reduces unnecessary CPU usage
  • 🔋 Improves battery life
  • 💻 Optimizes responsiveness during heavy workloads
  • 🧠 Smart async delay mechanism with DOM-based triggers
  • Fully respects cancellation (no memory leaks!)
  • 🧩 Compatible with all websites — no modifications to content
  • 🧪 Special handling for performance-sensitive sites like YouTube + Brave

🚫 What it doesn't do

  • ❌ It doesn’t block content, ads, or trackers
  • ❌ It doesn’t interfere with page visuals or features
  • ❌ It doesn’t slow down websites unnecessarily
  • ✅ It only intercepts background scripting in a subtle way

🖼️ Where does it run?

This script runs on all http:// and https:// pages, except direct links to file types like images or logs:

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

That means no interference with direct downloads, image views, or text-only pages.


🧪 Browser Compatibility

Browser Status
Chrome / Chromium ✅ Full support
Firefox ✅ Full support
Edge ✅ Full support
Brave ✅ Special handling for YouTube
Safari ⚠️ Mostly works, limited mutation timing accuracy

Also works with:

  • ✅ Tampermonkey
  • ✅ Violentmonkey
  • ✅ Greasemonkey (v4+)

🔐 Security & Safety

  • 🧠 No external libraries
  • 🕵️ No trackers or network requests
  • 🚫 Doesn’t collect or share data
  • 📦 MIT Licensed — open and inspectable

🧙 Author

CY Fung
🔗 GitHub Support Page


🧾 License

MIT License
You are free to use, modify, and redistribute.