YouTube CPU Tamer – Hybrid Edition (Improved)

Reduce CPU load on YouTube using hybrid DOMMutation + AnimationFrame strategy with dynamic switching and delay correction

Author
koyasi777
Daily installs
30
Total installs
58
Ratings
1 0 0
Version
4.00
Created
2025-04-24
Updated
2025-04-25
Size
8.51 KB
License
MIT
Applies to

🎯 YouTube CPU Tamer – Hybrid Edition (Improved)

🧩 Overview

This userscript is designed to reduce CPU load while browsing YouTube and YouTube Music.
It dynamically switches between requestAnimationFrame and MutationObserver depending on tab visibility, optimizing how setTimeout and setInterval behave.

  • ⚙️ Hybrid trigger system: switches based on visibility and DOM mutation
  • 🧠 Delay-aware timing with accurate execution control
  • 🔄 Automatically adapts when the tab becomes active or inactive
  • 🧼 Uses an iframe to isolate a clean execution context

🚀 How to Install

  1. Install Violentmonkey or Tampermonkey in your browser
  2. Add the script using the following link
    👉 Install this script

📌 Supported Sites

🔍 Technical Highlights

  • Wraps native timer APIs (setTimeout, setInterval) for CPU-friendly behavior
  • Uses MutationObserver to avoid unnecessary cycles in background tabs
  • Runs in a clean iframe-derived context to avoid pollution
  • Preserves .toString() signatures to avoid detection

👨‍💻 Developer Notes

  • Written in modern ES2020 JavaScript
  • No global namespace pollution
  • Uses @inject-into: page for deep YouTube integration

📜 License

MIT License
Feel free to use, modify, and distribute at your own discretion.


🎥 Enjoy YouTube with smoother playback and quieter CPU usage.