🧠 X.com 高級 JavaScript 優化器+

優化 X.com/Twitter 效能:移除高負載 CSS、限制 FPS、減少 DOM、暫停螢幕外影片、封鎖分析並在延遲時自動啟用高效模式。

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

作者
Oppai1442
今日安裝
16
安裝總數
555
評價
1 0 0
版本
1.3.6
建立日期
2025-10-22
更新日期
2025-11-08
尺寸
31.2 KB
授權條款
MIT
腳本執行於

🧠 X.com Heavy JS Optimizer+

⚡ Overview

X.com Heavy JS Optimizer+ is a high-performance userscript that dramatically reduces lag, scroll jank, and CPU load on X.com (Twitter).
It intelligently removes redundant animations, limits repainting, pauses offscreen videos, and caps JavaScript frame rates — all without breaking the core site experience.


🚀 Features

  • 🧹 Lightweight CSS Cleanup
    Removes heavy effects (backdrop-filter, blur, gradients) and disables GPU-stressing layers.

  • ⚙️ Passive Event Optimization
    Forces passive: true on scroll/touch listeners for smoother rendering.

  • 🎞️ Smart Video Control
    • Only one video can play at a time
    • Auto-pause when scrolled offscreen
    • Prevents auto-play and decoding spam

  • 🧩 DOM Feed Garbage Collector
    Keeps only the last N tweets in the DOM to prevent memory bloat.
    (Configurable from userscript menu.)

  • 📊 Metrics Blocking (Optional)
    Blocks unnecessary telemetry calls like scribe, engagement, and client_event.

  • Aggressive Runtime Mode
    Auto-detects long tasks and dynamically limits FPS (requestAnimationFrame) to maintain stability.

  • 💤 Tab Visibility Safety
    Auto-pauses all videos when tab is hidden.


🧰 Menu Commands

Available via ViolentMonkey / TamperMonkey menu:

  • 🧠 Toggle Aggressive Mode
  • 🧩 Set feed tweet limit
  • 📊 Enable/Disable metrics blocking

🧪 Benchmarks

Scenario Before After Improvement
Scrolling feed 100+ tweets ~48–55 FPS 90+ FPS +85%
Memory footprint (avg) 1.4 GB 650 MB −53%
CPU load (video active) 45–60% 25–30% −50%

(Tested on Brave 1.72 / Win10 / Ryzen 7 5800H)


⚙️ Compatibility

✅ Works on:

🧩 Supported managers:

  • ViolentMonkey ✅
  • TamperMonkey ✅
  • FireMonkey 🟡 (limited support)

💡 Tips

  • For best results, disable other performance-altering scripts or extensions.
  • You can monitor real-time CPU impact via Chrome DevTools > Performance.

🪄 Credits

Developed by Oppai1442
Made with ❤️, caffeine, and a stubborn hatred of lag

If you encounter any issues, please leave feedback — I’ll fix them as soon as possible.

License: MIT
View source on GreasyFork


⚠️ Disclaimer:
This script modifies rendering behavior for optimization purposes.
Use at your own discretion — functionality on experimental browsers may vary.