Greasy Fork

Web CPU Tamer

通过隐式的异步调度延迟减少浏览器的能耗

目前为 2025-04-05 提交的版本。查看 最新版本

作者
𝖢𝖸 𝖥𝗎𝗇𝗀
评分
0 0 0
版本
2025.100.2
创建于
2025-04-05
更新于
2025-04-05
大小
16.1 KB
许可证
MIT
适用于
所有网站

🌿 Web CPU Tamer (Implicit Delay for Scheduling)

Reduce your browser’s CPU usage and energy consumption with invisible async scheduling magic.


📌 What does this userscript do?

Web CPU Tamer adds subtle delays to JavaScript tasks running on websites. These delays are intelligently scheduled to give your browser time to "breathe" between heavy tasks — helping reduce CPU usage, heat generation, and power drain, especially on laptops and mobile devices.


💡 Why should I install this?

Modern websites often run a lot of background JavaScript — animations, tracking, analytics, timers, and more. This can:

  • Drain battery faster 🔋
  • Keep your fans spinning noisily 🌀
  • Slow down your system 🐌

This script helps by slowing down how often JavaScript tasks are processed, without breaking the website’s functionality. It’s like giving your browser scheduled naps so it can stay cool and responsive.


⚙️ How does it work?

The script modifies how these functions behave:

  • setTimeout(...)
  • setInterval(...)
  • requestAnimationFrame(...)

Before each task runs, it introduces two small, invisible delays using:

  • queueMicrotask() to yield to the browser,
  • A hidden MutationObserver trick to wait for a brief moment in the event loop.

This helps smooth out bursts of activity, letting the browser:

  • Render UI faster,
  • Finish layout/paint cycles without stuttering,
  • Save power in idle frames.

It works quietly in the background — you won’t notice it, but your CPU will!


✅ Key Features

  • Reduces unnecessary CPU wakeups
  • 🔋 Lowers energy impact of browsing
  • 💻 Improves responsiveness on low-power or older devices
  • 🌐 Works on most websites (excluding pure media/text files)
  • 🧠 Smart delay mechanism — no hardcoded timeouts!
  • 🧩 Does NOT interfere with page content or features

❌ What it doesn't do

  • ❌ It doesn’t block ads or trackers
  • ❌ It doesn’t change how websites look
  • ❌ It doesn’t break or modify any website functionality
  • ✅ It just makes everything a little more gentle on your system!

🔒 Safe & Clean

  • ✅ Open-source under the MIT License
  • ✅ No network requests or tracking
  • ✅ Runs on page load and in iframes (if applicable)
  • ✅ No external dependencies

🚫 Excluded File Types

To avoid interfering with non-HTML files, this script automatically excludes URLs that end in:

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

This way, it won’t touch direct image or text file links.


🧪 Compatibility

  • ✅ Works on Chrome, Firefox, Brave, Edge, and others
  • ✅ Compatible with Tampermonkey, Violentmonkey
  • ⚠️ Some behavior may be browser-dependent due to internal engine quirks

Special handling is included for Brave + YouTube where extra CPU patches may be enforced.


🧙‍♂️ Installation

Just click the “Install” button on GreasyFork and let Tampermonkey do the rest. The script will automatically run on all matching pages.


👨‍💻 Author

CY Fung
GitHub Support Page »


🧾 License

This userscript is licensed under the MIT License.


Notes

N/A