YouTube Helper API

YouTube Helper API.

Das sind Skriptversionen, bei denen der Quelltext aktualisiert wurde. Alle Versionen anzeigen.

  • v1.0.5 09.05.2026

    fix: corrected a regression introduced in the rewrite, player API retrieval logic now again correctly uses actualTargetPlayer to get preview players

  • v1.0.4 09.05.2026

    fix: added missing await for fallbackGetPlayerApi in updatePlayerState to prevent Promise-related element failures.

    refactor: consolidated getPlayerResponseWhenReady logic using a fetchResponse helper and streamlined the retry loop.

    perf: simplified iframe metadata synchronization by leveraging { once: true } event listeners.

    chore: removed redundant optional chaining (?.) on appState and availableTracks where structural existence is guaranteed.

  • v1.0.3 08.05.2026

    forgot to pass some events as function params during the rewrite. fixed that.

  • v1.0.2 08.05.2026

    fix: add optional chaining to player event target access to prevent null reference errors

  • v1.0.1 08.05.2026 Imported from URL
  • v1.0.0 03.05.2026

    MAJOR REWRITE Breaks compatibility with 0.x.x versions. (see new api structure in code. documentation will be updated soon)

    • Now separates the lib in to modules to better maintainability.
    • Fixes various memory and performance related bugs, particularly those that can hold zombie references to no longer exist DOM nodes on the YouTube SPA website.
  • v0.11.0 01.05.2026

    Added: Exposed an EVENTS constants object on the public API. Consumers can and should now use youtubeHelperApi.EVENTS.XYZ instead of hardcoded strings to prevent typos and enable IDE autocomplete.

  • v0.10.1 21.04.2026

    Fixed several significant memory leaks and dangling references caused by YouTube's Single Page Application (SPA) DOM caching.

  • v0.10.0 15.04.2026

    Updated to refire media events from YouTube Players no matter which player the events are from. Event details like the original event source and target are passed to the custom events. Updated progress tracking to trigger and notify for video state updated in the situations that video update video stream data without either using a new player element nor fire an event.

  • v0.9.7.6 26.03.2026

    Changed the script to only notify ads when an ad is detected instead of on all possible ad state changes.

  • v0.9.7.5 23.03.2026

    Updated page type name of the root domain from browse to home to match the new YouTube name.

  • v0.9.7.4 11.03.2026

    Added a temporary way to specifically opt out of storage save/load events.

  • v0.9.7.3 13.01.2026

    Fixed an issue that caused the GM shim to fail under certain conditions. In certain environments (Firefox + TamperMonkey tested) checking Object.getOwnPropertyDescriptor on global GM will crash the script, new version just sets without checking.

  • v0.9.7.2 10.01.2026

    Fixed a bug the GM shim and the API proxy logic that could crash the script in very rare cases. Minor fix, should be identical in behaviour in most cases.

  • v0.9.7.1 05.01.2026

    Fixed an issue that caused publicApi to not be returned by custom events. (Scoping issue)
    Make debug.log to default to calling debug.log[1].

  • v0.9.7 04.01.2026

    Made API instanced with UUIDs that are registered in a global registry.
    Allowed debug to be controlled from the global context space. This allowed debug to be toggled from the dev console in real-time.

  • v0.9.6 02.01.2026

    Atomic Debug System: Replaced the logging engine with direct function bindings for zero-overhead performance.
    Numeric Logging: Added support for accessing log levels via array indices (e.g., debug.log[0]) alongside named methods.
    Polite Read-Only Protection: Updated state proxies to silently block write attempts with a warning instead of crashing calling scripts.
    Switched back to the function form of 'use strict'.

  • v0.9.5 19.12.2025

    Fixed the check order inside the trackPlaybackProgress to reflect the correct logical availability.

  • v0.9.4 05.12.2025

    Added a 5th logging level.

  • v0.9.3.3 05.12.2025

    Tweaked logging level for a few messages.

  • v0.9.3.2 05.12.2025

    fix typo

  • v0.9.3.1 05.12.2025

    fix typo

  • v0.9.3 05.12.2025

    New Debug System: Added api.debug with 4 logging levels (minimal, typical, detailed, all). Logs point to the caller's line number.
    New Helpers: Added reloadToCurrentProgress() and exposed gmCapabilities.
    Internal Improvements: Library now uses the new debug system for cleaner console output and better error handling.

  • v0.9.2 01.12.2025

    Moved 'use strict' to global scope.
    Added added a shim for Greasemonkey API functions. This should catch missing GM or permission not granted errors without crashing.

  • v0.9.1 20.11.2025

    Fixed video playback language updates not being detected correctly.

  • v0.9.1 20.11.2025

    Update comments and logging.

  • v0.9.0 20.11.2025

    Switched to an isolated library pattern.

  • v0.8.0 19.11.2025

    Updated to be a global singleton. (again)
    Updated to inject into the newer/broader globalThis instead of window.

  • v0.7.6 18.11.2025

    Made language track detection more robust.
    Added logic to determine if the video is auto dubbed with its own appState value.

  • v0.7.5 14.11.2025

    Updated API logic to match YouTube's new audio track format.

  • v0.7.4 14.11.2025

    Fixed an issue that caused the script to notify itself being ready before the data has finished populating.

  • v0.7.3 14.11.2025

    Fixed a bug that caused the script process videos before all video data has loaded into the video player.

  • v0.7.2 09.11.2025

    Fixed a bug that caused the video html element to become stale after reloading throw YouTube's API. This seems to be new YouTube behavior introduced by the New Delhi (2025) UI update.

  • v0.7.1 08.11.2025

    Fixed a race condition where ad states and video states can update in random order depending on loading conditions.

  • v0.7.0 04.11.2025

    Fixed a bug that caused player updates to be handled event when video data does not exist.
    Fixed a race condition bug that caused the API to return incorrect data.

  • v0.6.2.1 04.11.2025

    fix type

  • v0.6.2 04.11.2025

    Excluded certain urls from being early processed.

  • v0.6.1 26.10.2025

    Updated to track if the current video has been streamed or premiered. (basically any format that could have a chat log would return true)

  • v0.6.0 25.10.2025

    Updated the API to directly reference read-only proxy objects for better performance.
    Updated page type to use the current page URL as fallback when YouTube's native API fails to return a proper response.

  • v0.5.8 17.10.2025

    Updated how the player api fallback working when running in iframes.
    Updated the listener player update event.

  • v0.5.7 01.10.2025
    New
    • Refactored storageApi to use a declarative lookup table, making it more readable and easier to extend.
    • Converted dynamic DOM element properties on the page object to use getters, ensuring references are always current on a Single Page Application.
    • Consolidated reloadVideo functions to remove duplicated code and follow the DRY principle.
    • Adopted underscore (_) prefix as a naming convention for internal functions to clearly separate them from the public API.
    • Added a console warning if a non-existent YouTube function was called through the API proxy instead of failing silently.
    Fixes
    • Fixed a bug that caused duplicate timeupdate event listeners to be added repeatedly by tracking listener attachment in a WeakMap.
    • Corrected storage functions to consistently use the storageApi abstraction instead of calling GM functions directly.
  • v0.5.6 01.10.2025

    Added a fuction to reload the current video.

  • v0.5.5 01.10.2025

    Added distinction between content that is live or was live (VOD), and content that is currently live exclusively.

  • v0.5.4 29.09.2025

    Added a private event target so we don't fire event into the document directly. Global event handshake may eventually be added.

  • v0.5.3 29.09.2025

    Use a singleton pattern for initiation to avoid duplicate events firing.

  • v0.5.2 29.09.2025

    Fixed tracked playback progress not updating when loading a new video.

  • v0.5.1 29.09.2025

    Updated all public storage functions to eager sync between script storage and local storage.
    Updated page type updating to listen for different events. Should now update earlier and more consistently.
    Fix time specified video detection. YouTube player response object turns out to be unreliable for this.

  • v0.5.0 29.09.2025

    No longer exposing storageApi.
    Added public delete and list functions for synced storage.

  • v0.4.8 29.09.2025

    Added support for time specified video detection.
    Added support for playlist id detection.
    Exposed storagedApi to publicApi.

  • v0.4.7 29.09.2025

    Fixed ad detection and tracking.

Alle Skript-Versionen anzeigen