Version 3.4 (Initial Combined Release)
Feature Merge: This version combines the functionalities of two previously separate UserScripts:
"YouTube Grid Auto-Scroll & Search (Ultra Optimized - Instant) - More Robust Visibility Handling" (assumed v3.3)
"YouTube Channel Full Video Preloader" (assumed v2.1)
New Integrated Feature: Channel Full Video Preloader
Adds a "Загрузить ВСЕ видео (со скроллом)" button, now appearing on the bottom-right of YouTube channel "videos" pages (e.g., youtube.com/channel/UC.../videos or youtube.com/@handle/videos).
When clicked, the script scrolls down the page to progressively load all videos listed on the channel.
A progress indicator (Прокрутка... (X видео)) is shown on the button during scrolling.
After scrolling is complete, it confirms if the user wants to open all found video links in new background tabs.
Uses GM_openInTab to open videos in the background with a slight delay between each to prevent browser issues.
All preloader-related UI text (button, prompts) remains in Russian.
The preloader button's appearance/disappearance is handled correctly during YouTube's single-page application (SPA) navigations.
Retained Feature: Grid Auto-Scroll & Search
The existing search interface (input field, "Поиск", "Стоп", "Пред.", "След." buttons) remains in the YouTube masthead for searching videos within feeds, search results, and other grid layouts.
Continues to highlight matching video titles with an animated border.
Automatically scrolls to the next found video.
Includes error messages ("Не удалось найти шапку YouTube...", "Поиск прерван по таймауту.") and a "Совпадений не найдено" message, displayed centrally.
Handles dynamic content loading and browser visibility changes.
All grid-search related UI text remains in Russian.
Technical Changes & Unification:
Single Script: Both functionalities are now managed within a single UserScript file.
Unified Styles: CSS for both features has been combined into a single GM_addStyle block.
Grant Consolidation: @grant directives now include both GM_addStyle (for both features) and GM_openInTab (for the preloader).
Variable & Function Scoping:
Internal variables and functions from the preloader script were carefully integrated and, where necessary, renamed to prevent naming collisions and improve clarity within the combined codebase (e.g., preloadButton became preloadButtonPreloader, isLoadingState became isLoadingStatePreloader; grid search message functions like showErrorMessage became showErrorMessageGridSearch).
Initialization:
The grid search UI is initialized when the script loads on any YouTube page.
The channel preloader button is initialized conditionally, only appearing on relevant /videos pages, and its state is managed by a MutationObserver that watches for URL changes (SPA navigation).
DOM Element IDs: IDs for UI elements from both scripts have been maintained (e.g., #floating-search-box, #yt-channel-full-preload-button).
Z-Index Management: The z-index for the preloader button has been set slightly lower than the grid search's pop-up messages to ensure messages are displayed on top if they were to overlap.
Metadata Update: UserScript metadata (@name, @version, @description) has been updated to reflect the combined nature of the script. The @run-at directive is set to document-idle.