🧿 Additional Information
🧠 Universal Governor Suite (v2.3 Unified Engine) is a lightweight, single-engine userscript designed to improve browser responsiveness by coordinating media optimization, DOM processing, idle detection, and network request scheduling into one unified control system.
Instead of relying on multiple independent loops or scattered observers, it uses a central heartbeat-driven scheduler that dynamically adjusts behavior based on user activity and page pressure.
The script remains non-invasive and preserves full site functionality. It does not alter application logic, playback behavior, or data flow. Instead, it improves performance stability through controlled timing, batching, and request pacing.
All processing is handled locally using low-overhead browser-native systems such as MutationObserver batching, IntersectionObserver visibility tracking, and a single adaptive execution loop.
⚡ Stability Value for Script-Heavy Browsing Environments
This script is especially useful for environments where multiple userscripts operate simultaneously (Tampermonkey / Violentmonkey / Greasemonkey setups), particularly when those scripts independently:
- trigger frequent
fetch() polling loops
- run overlapping API refresh timers
- inject background request cycles
- execute DOM mutation-heavy updates
- refresh widgets, overlays, or dashboards in parallel
Without coordination, these can create request synchronization spikes, leading to:
- CPU bursts
- network congestion spikes
- inconsistent API timing
- frame drops during DOM updates
- unstable polling behavior under load
🧠 The Governor introduces a shared execution pacing model that smooths these effects using a unified queue system with controlled concurrency and burst-aware delay logic.
Instead of allowing immediate execution, requests are spaced out deterministically, reducing collision between independent scripts.
⚡ What It Does
🎥 Media Optimization Layer
- Applies safe performance hints to all
<video> elements during initial load and dynamic injection
- Uses
IntersectionObserver to track visibility and reduce unnecessary work on off-screen media
- Optimizes preload strategy (
auto, metadata, or none under data saver conditions)
- Enables inline playback stability across mobile and desktop environments
- Uses
decoding: async to reduce blocking decode pressure
- Applies
fetchPriority hints where supported
- Prevents duplicate processing using lightweight internal flags (
__touched, __o)
- Uses batched MutationObserver processing to handle dynamically added content
- Adds layout stability hints (
content-visibility, intrinsic sizing)
- Marks visibility state (
dataset.visible) for lightweight tracking and responsiveness decisions
🌐 Network Stability Layer
- Wraps
fetch() and XMLHttpRequest into a unified queued execution system
- Limits concurrent network operations to prevent request spikes
- Applies adaptive delay based on queue pressure and burst thresholds
- Smooths polling-heavy behavior across multiple scripts and page systems
- Reduces synchronized request storms caused by overlapping timers
- Preserves original request semantics while controlling execution timing
- Prevents sudden bursts of API calls during DOM or visibility changes
🧠 Unified Engine Design
The current version consolidates all subsystems into a single adaptive heartbeat architecture:
- One shared scheduler controls DOM + network + idle behavior
- One MutationObserver feeds a single batching pipeline
- One IntersectionObserver tracks video visibility state
- One queue system handles all network execution
- One activity model determines active vs idle mode
Core behavioral model:
- ACTIVE mode: fast responsiveness, frequent processing cycles
- IDLE mode: reduced execution frequency and lower scheduling pressure
- Automatic transition based on user input, visibility changes, and DOM activity
This design eliminates duplicated timers and reduces internal overhead while maintaining responsiveness.
🌙 Idle System Behavior
The idle system is event-driven rather than interval-based.
It activates based on:
- no user input for ~12 seconds
- no recent DOM activity
- no visibility-triggered updates
- stable queue state
When idle:
- execution cadence slows significantly
- DOM batching continues but less frequently
- network scheduling is deprioritized
- system conserves CPU resources
When activity resumes:
- any scroll, mouse movement, keyboard input, or visibility change immediately restores ACTIVE mode
- scheduler returns to full responsiveness without delay
🎥 Video Detection Reliability
Video handling is highly reliable in modern DOM environments.
The system detects videos through:
- Initial full-page scan (
querySelectorAll("video"))
- MutationObserver detection for dynamically injected videos
- Recursive scanning of newly added DOM nodes
- IntersectionObserver tracking for visibility changes
Behavior in dynamic feeds (e.g. X.com, Reddit, TikTok-like feeds):
- Yes — it will detect new videos as they appear while scrolling
- Each newly injected
<video> element is processed exactly once
- Visibility changes are continuously tracked via IntersectionObserver
- No need for page reload or reinitialization
So it does not only run at startup — it continuously adapts as content loads.
🎨 Visual Layer Behavior
The visual optimization layer globally removes expensive rendering effects:
- backdrop-filter
- -webkit-backdrop-filter
- filter
- box-shadow
- text-shadow
This is applied via a single global CSS injection at document-start.
Additionally:
- transform: translateZ(0)
- will-change: transform, opacity
- content-visibility: auto
🚫 Site Exclusions (Persistent Control System)
The script includes a persistent exclusion system.
How it works:
- Stores excluded domains using GM_getValue
- Checks hostname at startup
- Fully disables script if match is found
- Supports subdomain matching
Controls:
- Exclude this site → disables all layers
- Clear exclusions → resets stored list
🔐 Privacy
- Does NOT collect data
- Does NOT send external requests
- Does NOT track behavior
- Runs fully locally
⚙️ Performance Notes
Media Layer:
- Weak internal flags prevent duplicate processing
- MutationObserver batching reduces DOM churn
- IntersectionObserver avoids unnecessary work
Network Layer:
- Unified queue prevents burst execution
- Concurrency limiting avoids overload
- Adaptive delay smooths spikes
Scheduler Layer:
- Single heartbeat replaces multiple timers
- Idle mode reduces execution frequency
- Activity-driven wake system ensures responsiveness
📜 License
MIT License