YouTube CPU Tamer by DOMMutation

ลดผลกระทบทางพลังงานของเบราว์เซอร์ในการเล่นวิดีโอ YouTube

ผู้เขียน
DR LEONK
จำนวนติดตั้งประจำวัน
4
จำนวนติดตั้งทั้งหมด
28
คะแนน
0 0 0
เวอร์ชัน
2025.02.24.0
สร้างเมื่อ
31-03-2025
อัปเดตเมื่อ
31-03-2025
Size
22 กิโลไบต์
สัญญาอนุญาต
MIT
ปรับใช้กับ

Optimize YouTube CPU Usage - Non GPU Accelerated Hardware/Browser

Compatible with Tampermonkey / Violentmonkey / FireMonkey
Description
This userscript reduces CPU and energy consumption on YouTube pages (main page, embedded videos, live chats, and YouTube Music) by optimizing JavaScript timer management.

- Faster performance: Reduces unnecessary task execution.
- More stable playback: Prioritizes video-related tasks.
- Lower battery usage: Minimizes CPU load, especially on laptops and mobile devices.

Note 1: Overrides native setTimeout, setInterval, clearTimeout, and clearInterval functions.
Note 2: Adjusts task frequency in background tabs to save energy.

Script Description
"YouTube CPU Tamer by is a userscript crafted to lower your browser's energy footprint while streaming YouTube videos. Here's how it works, what it does, and how to use it:
What does it do?
The script optimizes JavaScript timers (setTimeout and setInterval) that YouTube heavily relies on, reducing CPU usage and power consumption for a smoother, more efficient experience.
How does it work?
Upon activation, it performs these key operations:

1. Custom Timer Overrides: Replaces native setTimeout and setInterval with versions that use requestAnimationFrame, syncing tasks with the browser's rendering cycle to cut down on redundant processing.
2. Optimized Task Scheduling: Employs a continuous requestAnimationFrame loop to manage pending tasks, enhancing efficiency over traditional timers, especially for animations and UI updates.
3. Interval Management: Balances the execution frequency of recurring tasks to maintain functionality without overloading the CPU.
4. Background Optimization: Reduces task execution rates in inactive tabs, leveraging browser throttling to conserve energy.
5. Error Prevention: Includes safeguards against duplicate calls and ensures compatibility with YouTube's dynamic loading.
How to Install and Use:
1. Install a userscript manager (e.g., Tampermonkey, Violentmonkey, or FireMonkey).
2. Add the script via your manager.
3. It runs automatically on YouTube pages—no further action required.

Effectiveness may vary based on device specs, YouTube page type, and other extensions. Keep your browser and manager updated for best results.