Universal Browser & Script Governor

Unified media optimization and adaptive network scheduling layer that smooths playback performance, reduces DOM and network spikes, and improves overall browser stability without interfering with core site behavior.

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:

Autor
Michael Stutesman
Dnevne instalacije
10
Ukupnih instalacija
10
Ocjene
0 0 0
Verzija
1.4
Stvoreno
24.06.2026.
Ažurirano
25.06.2026.
Size
5,68 KB
Licenza
MIT
Primjenjuje se
Sve stranice

🧿 Additional Information

🧠 Universal Browser & Script Governor is a lightweight, dual-layer performance userscript designed to improve how modern websites handle both media rendering and network request behavior.

It extends traditional media optimization by adding an adaptive network scheduling layer that helps smooth out request spikes, reduce burst congestion, and improve overall responsiveness on dynamic web applications.

The script remains non-invasive and does not alter playback logic or site functionality. Instead, it enhances browser efficiency through safe media hints and controlled request timing.

All operations are handled locally using low-overhead systems including MutationObserver batching and a lightweight request queue scheduler.


⚡ Stability Value for Script-Heavy Browsing Environments

This script is especially useful for users who run multiple userscripts at the same time (e.g., Tampermonkey, Violentmonkey, Greasemonkey setups), where different scripts may independently:

  • trigger frequent fetch() polling loops
  • run overlapping API refresh timers
  • inject background data requests
  • execute DOM-driven polling behaviors
  • refresh widgets, overlays, or dashboards simultaneously

Without coordination, these scripts can unintentionally create synchronized network spikes, where multiple independent timers fire at once, causing:

  • temporary CPU spikes
  • network congestion bursts
  • UI stutter or frame drops
  • inconsistent API timing behavior
  • unpredictable request ordering

🧠 Universal Browser & Script Governor introduces a shared execution pacing layer that smooths these conflicts by queuing and spacing network activity.

Instead of allowing all scripts to execute requests instantly, it distributes execution over time using adaptive scheduling logic.

This improves:

  • multi-script coexistence stability
  • request timing consistency
  • reduction of polling collisions
  • smoother API behavior under load
  • overall browser responsiveness in automation-heavy environments

⚡ What It Does

🎥 Media Optimization Layer

  • Optimizes dynamically injected video elements using safe performance hints
  • Improves preload behavior for faster and more efficient media loading
  • Enhances inline playback compatibility across mobile and desktop browsers
  • Reduces unnecessary decoding work using decoding: async
  • Applies fetchPriority hints where supported by the browser
  • Prevents duplicate processing using a WeakSet tracking system
  • Uses batched MutationObserver updates for low CPU overhead
  • Adds lightweight layout stability hints (contentVisibility, intrinsic sizing)
  • Injects safe DNS prefetch hints for common media CDNs
  • Includes persistent per-site exclusion system for compatibility control

🌐 Network Stability Layer

  • Intercepts fetch() and XMLHttpRequest calls
  • Queues network requests to prevent burst congestion
  • Applies adaptive delays based on request pressure
  • Limits concurrent request execution to reduce spikes
  • Introduces lightweight jitter to prevent synchronized request storms
  • Smooths polling-heavy and API-heavy website behavior
  • Helps reduce CPU/network contention during dynamic page updates

🧠 Design Philosophy

This script follows a strict dual-layer, non-invasive optimization model:

  • MutationObserver-only incremental DOM processing
  • Lightweight request scheduling without blocking critical execution paths
  • No playback control (no play, pause, or volume changes)
  • No external communication or telemetry
  • No full-document scanning after initialization
  • No modification of application logic or data flow
  • Strict separation of media optimization and network scheduling layers

The goal is to improve both media responsiveness and network stability while preserving full site behavior integrity.


🚫 Site Exclusions (Persistent Control System)

The Governor includes a built-in persistent site exclusion system designed for safety and flexibility.

Some websites may not behave correctly when network timing or DOM optimization layers are applied. For this reason, users can permanently exclude specific domains.

How it works:

  • Exclusions are stored locally using GM_getValue and GM_setValue
  • Each excluded site is saved by hostname (domain-level control)
  • The script checks exclusions at startup and immediately disables itself if matched
  • Applies to both media and network layers simultaneously

User control options:

  • 🚫 “Exclude this site” → instantly disables Governor on current domain
  • 🔄 “Clear exclusions” → resets all saved exclusions
  • Changes take effect immediately after reload

Why this matters:

This system ensures the Governor remains:

  • safe for sensitive websites
  • compatible with authentication-heavy services
  • adaptable for real-time applications (chat, finance, dashboards)
  • non-destructive in unpredictable environments

It effectively turns the script into a selective stability layer rather than a global override system.


🔐 Privacy

This script:

  • Does NOT collect any user data
  • Does NOT send information externally
  • Does NOT use analytics or tracking
  • Does NOT communicate with remote servers

All processing occurs locally inside the browser.


⚙️ Compatibility

Designed for broad compatibility across modern websites including video-heavy and API-heavy applications.

On highly optimized or proprietary platforms, some behaviors (especially request scheduling) may be partially overridden by native browser or site-level logic.

Exclusion mode is strongly recommended for:

  • Real-time applications (chat, trading, live dashboards)
  • Sites sensitive to request timing
  • Services with strict authentication refresh timing

⚡ Performance Notes

This script is intentionally lightweight and structured around a dual-performance architecture:

🎥 Media Layer

  • WeakSet prevents duplicate processing
  • Mutation batching reduces DOM churn
  • No continuous polling or full-page scans

🌐 Network Layer

  • Request queue prevents burst execution
  • Adaptive timing reduces congestion spikes
  • Concurrency limiting avoids request overload
  • Dynamic delay smoothing under load

Together, these systems reduce both rendering spikes and network contention while maintaining stable browser performance.


📜 License

This project is released under the MIT License.

You are free to:

  • Use this software for personal or commercial purposes
  • Modify and adapt the code freely
  • Redistribute copies of the script
  • Create derivative works based on it

Conditions:

The software is provided "as is", without warranty of any kind.
The author is not liable for any issues arising from its use.