Universal Website Optimizer (v3 Spec) / 通用網站優化工具 (v3)

特務E04
2024-07-18T14:59:39Z

The ultimate performance booster for modern web browsing. Optimizes CPU, RAM, Network, and Storage usage while maintaining site functionality.

Universal Website Optimizer (v3)

English | 繁體中文

🇬🇧 English Description

Universal Website Optimizer v3.0 is a complete rewrite of the original performance script. It is designed to be the ultimate performance booster for modern web browsing, significantly reducing CPU, RAM, Network, and Storage usage without breaking website functionality.

Unlike previous versions that used aggressive stop-loading techniques, v3.0 uses a smart, modular architecture to surgically remove bloat and throttle background processes.

🚀 Key Features

Smart Background Throttling (PerformanceEngine):

Automatically detects when a tab is in the background.

Reduces animation frame rates (RAF) and throttles JavaScript timers to near-zero activity.

Result: Massive CPU/RAM savings for inactive tabs. Shows a 💤 status in the tab title.

Active Network Interception (NetworkController):

Intercepts fetch and XHR requests before they leave the browser.

Blocks analytics, trackers, and heavy ad scripts at the source.

Result: Faster page loads and reduced bandwidth usage.

Native Lazy Loading (DOMHandler):

Enforces loading="lazy" on images and iframes.

Stops video autoplay and optimizes font loading strategies (swap).

Result: Near-instant initial page rendering.

Visual Rendering Optimization:

Injects content-visibility: auto CSS to prevent rendering of off-screen content.

Reduces GPU/CPU paint cycles on long pages.

Configurable Menu:

Toggle features on/off instantly via the Userscript Manager menu.

📥 Installation

1. Install a Userscript Manager (e.g., Tampermonkey, Violentmonkey).

2. Click here to install the script.

3. Refresh your webpages to see the difference!

⚙️ Configuration

You can toggle specific optimizations via the Tampermonkey menu:

Rocket 🚀: Toggle Background Throttling.

Image 🖼️: Toggle Image Lazy Loading.

Shield 🛡️: Toggle Tracker Blocking.

Font 🅰️: Toggle Font Optimization.

Thunder ⚡: Toggle Simplified Mode (Experimental - removes decorations/shadows).

🇹🇼 繁體中文介紹

通用網站優化工具 v3.0 是一次徹底的代碼重構與升級。我們的目標是打造一款極致的瀏覽器效能優化工具，在保證網站功能正常運作的前提下，最大限度地降低 CPU、RAM、網路頻寬 與 硬碟讀寫 的消耗。

不同於舊版本較為暴力的攔截方式，v3.0 採用了模組化的智慧架構，能夠精準地移除網站贅肉並凍結背景資源。

🚀 核心功能

智慧背景資源凍結 (PerformanceEngine)：

自動偵測分頁是否處於背景狀態。

當分頁不可見時，強制降低動畫幀率 (FPS) 並大幅延長 JS 計時器執行間隔。

效果：背景分頁幾乎不佔用 CPU 資源。標題會顯示 💤 符號作為提示。

主動式網路攔截 (NetworkController)：

在請求發出之前直接攔截 fetch 和 XHR。

從源頭阻擋 Google Analytics、Hotjar 等追蹤器與高流量廣告腳本。

效果：顯著提升網頁載入速度並節省流量。

原生級延遲加載 (DOMHandler)：

強制為所有圖片與 iframe 添加 loading="lazy" 屬性。

禁止影片自動播放，並優化字型載入策略。

效果：網頁開啟瞬間即可看到內容，無需等待所有圖片下載。

視覺渲染優化：

注入 content-visibility: auto CSS，讓瀏覽器忽略螢幕畫面外的複雜區塊渲染。

大幅減少長網頁捲動時的卡頓感。

可視化設定選單：

透過腳本管理器選單，一鍵開關特定功能。

📥 安裝說明

1. 請先安裝使用者腳本管理器（推薦 Tampermonkey 或 Violentmonkey）。

2. 點擊此處安裝腳本。

3. 重新整理您的網頁即可生效！

⚙️ 設定選單

點擊瀏覽器擴充功能列的 Tampermonkey 圖示，即可看到以下選項：

🚀 背景資源限制：開關背景凍結功能。

🖼️ 圖片延遲加載：開關圖片懶加載。

🛡️ 阻擋追蹤廣告：開關廣告/追蹤器攔截。

🅰️ 字型載入優化：開關字型顯示優化。

⚡ 極簡模式：開關極簡模式（實驗性：移除陰影、裝飾性元素，讓網頁變平）。

🔧 Technical Details / 技術細節

The v3.0 architecture is built on three main classes: v3.0 架構基於三個核心類別：

1. PerformanceEngine: Manages CPU cycles. Hooks into requestAnimationFrame, setTimeout, and setInterval to throttle activity when usability is unaffected.

2. NetworkController: Manages I/O. Uses Proxy-like patterns to intercept window.fetch and XMLHttpRequest prototype methods.

3. DOMHandler: Manages the DOM. Uses MutationObserver and IntersectionObserver to sanitize HTML and lazy-load assets dynamically.

⚠️ Disclaimer / 免責聲明

This script is experimental. While widely tested to ensure stability, some complex single-page applications (SPAs) might behave unexpectedly with aggressive throttling. Use the Menu to disable specific features if you encounter issues on certain sites.

本腳本為實驗性質。雖然經過廣泛測試以確保穩定性，但在某些複雜的單頁應用程式 (SPA) 上，激進的資源限制可能會導致非預期的行為。若在特定網站遇到問題，請透過選單關閉部分功能。