Greasy Fork

来自缓存

Greasy Fork is available in English.

🧠 X.com 高级 JavaScript 优化器+

优化 X.com/Twitter 性能:移除高负载 CSS、限制 FPS、减少 DOM、暂停屏幕外视频、屏蔽分析并在卡顿时自动启用高性能模式。

这些是此脚本变更过代码的版本。 显示所有版本。

  • v1.3.2 2025-10-23
  • v1.3.1 2025-10-23

    🧠 X.com Heavy JS Optimizer+ — Changelog

    v1.3.1-pre (2025-10-23)

    Fixes & Stability

    • Fixed critical TypeError: root.querySelectorAll is not a function caused when onReady() fired before the DOM was available.
    • Added safety guards for both scanVideos() and scanImg() to prevent crashes on non-Element nodes.
    • Ensured first DOM scan is triggered correctly using onReady() (no more skipped optimization for initial videos/images).
    • Improved overall stability on browsers with aggressive preload or delayed DOM construction.

    Performance Enhancements

    • Maintained @run-at document-start for maximum patch coverage (fetch, rAF, and setInterval hooks initialize early).
    • Added lightweight checks to reduce redundant MutationObserver calls.
    • Optimized early CSS injection timing for faster compositor cleanup.

    Behavior Improvements

    • Video & image optimization now runs both:
      • Once after DOM ready (onReady).
      • Continuously via live MutationObserver for new tweets.
    • Prevented double-injection and redundant event listeners.

    Developer Notes

    • This version is functionally identical to v1.3.0, but much safer and crash-free.
    • Considered stable for daily use.
    • Future builds will focus on:
      • Live FPS/Memory overlay (performance HUD).
      • Smart DOM cleanup (auto remove old tweets after 10+ minutes).

    v1.3.0 (Initial Public Release)

    Core Features

    • Full optimization suite for X.com/Twitter:
      • Removes heavy CSS (blur, backdrop-filter, linear-gradient).
      • Forces content-visibility: auto on feed articles for massive paint savings.
      • Caps frame rate to ~45 FPS during long tasks (Aggressive Mode).
      • Pauses offscreen videos and enforces single active video decoding.
      • Auto-lazy-loads and async-decodes all images.
      • Optionally blocks analytics (scribe, metrics, client_event, etc.).
    • User menu (GM_registerMenuCommand) to toggle:
      • Aggressive Mode ON/OFF
      • DOM feed limit
      • Analytics blocking

    Adaptive Runtime

    • Auto-detects browser long tasks via PerformanceObserver.
    • Dynamically enables “Aggressive” or “Ultra” mode when lag spikes.
    • Reduces setInterval density to lighten CPU usage.

    Author

    Oppai1442
    GreasyFork Profile

    License: MIT

  • v1.3.0 2025-10-22