Speeds up page loading: on video-hosting sites, priority is given to the main video; on other sites, priority is given to visible content.
Objective: To speed up page loading: on video-hosting sites, prioritize the main video; on other sites, prioritize visible content.
Speeds up the loading and rendering of any website. Runs seamlessly in the background from the very first millisecond the page opens.
Key improvements compared to surfing without a script:
On video-sharing sites (YouTube, Rutube, Twitch, Vimeo, Odysee, etc.), the script locates the main player on the page and forces it to have the highest loading priority—the video begins buffering before banners, recommendations, and other page content load. On YouTube, the internal metrics collection system (ytcsi/ytStats) is additionally disabled to free up CPU; recommendations and comments are rendered lazily via content-visibility:auto. CDN connections are warmed up: static CDNs before playback starts, dynamic CDNs at the moment the first video segment is requested (using PerformanceObserver to detect the real CDN host). On OK.ru, the main video is additionally tracked via the standard W3C MediaEvents composed-event mechanism through the player's Shadow DOM.
On standard websites (articles, news, blogs, forums), images and iframes outside the visible area do not load until the user scrolls to them—the browser allocates all available bandwidth to what the user can currently see. Images on the first screen load with the highest priority. On slow connections this happens proactively when the element appears in the DOM; on fast connections reactively via the LCP Observer after first paint (controlled by the LCP_IMAGE_BOOST flag).
On all websites, the script blocks data from being sent to popular analytics trackers (Google Analytics, Yandex.Metrica, Facebook Pixel, Hotjar, etc.) and removes their elements from the DOM before they have a chance to load. External web fonts do not block text rendering—the page displays text using the system font immediately, while the web font loads in the background. Smooth scrolling (scroll-behavior: smooth) is replaced with instant response (except for chats where it matters for UX).
Host-specific optimizations for VK/OK.ru (skeleton and ad removal via CSS), Rutube (player isolation, ad blocking), Yandex/Dzen (ad label suppression via ARIA and data-attributes), YouTube (extended ad element blocking, endscreen, pause-overlay removal).
Once the page has loaded and the user begins scrolling down, the script resolves DNS for domains of links on previously viewed screens in the background—clicking links will be faster.
Connection quality assessment happens once at startup: via OS connection type, TTFB (including redirects), and RTT/downlink metrics. On slow connections, more aggressive prioritization strategies are applied.
Can pause videos (except PiP playback) when switching to another tab, to save data and device resources (controlled by PAUSE_ON_HIDDEN flag; enabled by default).
In EXTREME mode (ON[E]), additionally: third-party domain scripts receive low fetch priority, while the site's own modules (Vue/React/Next.js bundles) are protected from deprioritization (controlled by SAME_ORIGIN_SCRIPT_PROTECT flag).
VIDEO_HOSTS arrayVIDEO_PATH_SEGMENTS arrayVIDEO_HOST_EXCEPTIONS arrayCHAT_SKIP_HOSTS set (scroll optimizations are disabled for these)VIDEO_CDN_MAP dictionary (also used for static preconnect)If part of a page isn't loading because an analytics element is being blocked, comment it out in the TRACKERS array. If a video host's CDNs have changed, update VIDEO_CDN_MAP.
Long-pressing (4 sec) the button displays page load indicators:
The button cycles through modes:
ON[A] → OFF → ON → ON[E] → ON[A]…
| Mode | Description |
|---|---|
| ON[A] | Auto — automatically selects ON for Desktop or ON[E] for Mobile |
| ON | Standard optimizations without changing the site's visual design |
| ON[E] | Extreme — everything in ON plus deprioritizing third-party scripts and simplifying visual design; best for slow internet or Mobile |
| OFF | Script disabled for this site; use if a page renders incorrectly |
DEBUG = false (default)
Displays performance metrics in the console (F12): TTFB, load time, LCP boost (who assigned priority — browser or IHW), connection quality (_isSlow), own-script protection (SOP), player canplay time. Useful for assessing the effect on a specific page.
PAUSE_ON_HIDDEN = true (default)
Pauses video when switching to another tab and resumes playback on return. Does not affect PiP. Works on YouTube and Twitch. Disable if the site manages pausing itself.
LCP_IMAGE_BOOST = true (default)
On standard sites (Mixed Content), boosts the fetch priority of the page's main image (LCP candidate). Strategy depends on connection speed: on slow connections proactively when the element appears in DOM, on fast connections reactively via LCP Observer.
SAME_ORIGIN_SCRIPT_PROTECT = true (default)
In ON[E] mode, protects the site's own domain scripts (Vue/React/Next.js bundles) from fetch priority reduction. Without this, SPA hydration on EXTREME mode could be delayed.
DYNAMIC_PRECONNECT_LIMIT = 3
Maximum number of dynamic preconnect connections to video CDNs. Browsers support a limited number of parallel connections — do not exceed 3.
BTN_BOTTOM = '70px'
Distance from the bottom of the screen to the mode button. Change if the button overlaps site elements.
VIDEO_CDN_MAP
Dictionary of CDN domains for each video host. Used for static preconnect (before playback starts). If CDNs have changed — update here.
STATIC_DELAYS
Delays (ms) for static preconnect of specific hosts or CDNs. For example, TikTok has a 200ms delay to avoid occupying HTTP/2 slots at page start.