Universal Governor Suite

Unified browser & script governor with media optimization, idle-aware scheduling, and network spike control for improved stability across dynamic web apps.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Advertisement:

Tekijä
Michael Stutesman
Päivittäiset asennukset
10
Asennuskerrat
20
Arvostelut
0 0 0
Versio
2.4.3
Luotu
24.6.2026
Päivitetty
26.6.2026
Size
6,7 kt
Lisenssi
MIT
Käytössä
Kaikki sivustot

🧿 Additional Information


🧠 Universal Governor Suite (v2.4.1 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 unified execution pacing model that smooths these effects using a single 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 system 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

🌙 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 active resumes:

  • immediate return to full responsiveness
  • scheduler wakes instantly from any interaction

🎥 Video Detection Reliability


Video detection sources:

  • Initial full-page scan (querySelectorAll("video"))
  • MutationObserver detection for dynamically injected videos
  • Recursive DOM scanning for new nodes
  • IntersectionObserver visibility tracking

Dynamic feed behavior (X.com, Reddit, TikTok-style feeds):

  • New videos are detected while scrolling
  • Each video is processed once
  • Visibility updates continuously
  • No refresh required

🎨 Visual Layer Behavior


The visual optimization layer globally removes:

  • backdrop-filter
  • -webkit-backdrop-filter
  • filter
  • box-shadow
  • text-shadow

Applied at document-start.

Also improves rendering stability using:

  • transform: translateZ(0)
  • will-change: transform, opacity
  • content-visibility: auto

🚫 Site Exclusions (Persistent Control System)


  • Stored via GM_getValue
  • Matches hostname/subdomain
  • Fully disables script when matched
  • Exclusion list persists across sessions
  • Controlled via userscript dropdown menu commands
  • Supports manual add/remove via menu
  • Prevents script initialization before engine startup
  • Uses early-exit check before observers or schedulers initialize

🔐 Privacy


  • No data collection
  • No external requests
  • No tracking
  • Fully local execution

⚙️ Performance Notes


Media Layer:

  • Mutation batching reduces DOM churn
  • IntersectionObserver reduces idle work

Network Layer:

  • Unified queue prevents bursts
  • Concurrency limiting stabilizes load

Scheduler Layer:

  • Single heartbeat replaces multiple timers
  • Idle mode reduces CPU pressure
  • Activity-driven wake system ensures responsiveness

📜 License


MIT License