Tampermonkey Video Filter v4.1

Filters posts with videos/GIFs using dynamic content detection. Extended video format support, GIF thumbnails, caching, performance optimizations, thumbnail retry, and new toggles: "Search revisions" + "Include GIFs" + "Error 429 fix".

These are versions of this script where the code was updated. Show all versions.

  • v1.4.0 2026-04-01

    New Features

    • Error 429 fix toggle – New setting in the panel that automatically retries pages that return 429 (Too Many Requests) up to 5 times with 2-second delays (≈10 seconds total).
    • Clear 429 failure display – Failed pages now appear on a separate red line below the "Showing..." text (e.g. Pages 11, 12, 15 and 20 failed due to error 429.).
    • Live refetch progress – Shows Refetching page X due to error 429 1/5... in the status bar while retrying.

    Technical Improvements

    • All toggles (Search revisions, Include GIFs, Error 429 fix) now use Tampermonkey GM storage (GM_getValue / GM_setValue) instead of localStorage.
    • Settings are now 100% persistent even when localStorage quota is exceeded (common on Zen Browser / heavy caching).
    • Cache system gracefully handles QuotaExceededError with a clear warning instead of breaking the script.
  • v1.3.2 2026-03-29

    New Features

    Technical Improvements

    • Updated determinePageContext() to detect tag parameter
    • Updated buildApiUrl() to automatically include tag=... in API requests when present
  • v1.3.1 2026-03-29

    New Features & Improvements

    • Thumbnail Caching (24-hour TTL)
      Thumbnails are now cached using the existing localStorage system with a dedicated 24-hour TTL (separate from the 5-minute API cache). This greatly reduces duplicate image requests and improves load times on repeated filters.
    • Live Thumbnail Loading Progress
      The status bar now shows real-time progress: Loading thumbnails: X/Y. This prevents the UI from staying stuck on the last “Fetching...” message and gives clear feedback while videos are loading.

    Technical Improvements

    • Optimized Cache System
      cache.get() and cache.set() now support per-entry TTLs. Thumbnail previews use the new 24h TTL while API responses remain at 5 minutes.
    • Better Progress Tracking
      Renamed counters to totalThumbnailsToLoad / thumbnailsLoadedCount for clarity. Progress is initialized immediately after fetching so the counter is visible right away.
    • UI Polish
      Collapse button now perfectly matches the full height of the filter panel (using top: 12px + bottom: 12px).
      Status row (progress + settings button) is cleanly aligned with flexbox for a tighter, more professional look.

    Bug Fixes

    • Fixed collapse button height that previously didn’t fill the panel correctly.
    • Thumbnail loading progress no longer gets stuck on the final “Fetching revision...” or “Fetching page...” message.
  • v1.3.0 2026-03-29

    New Features

    • Include GIFs Toggle
      Added a toggle to optionally include GIFs in filtering. Defaults to videos only (previous behavior). Setting persists across sessions.

    • Search Revisions (Kemono Only)
      When enabled, the script checks post revisions for any media if the main post lacks it. The latest revision containing a video or GIF will be displayed with a direct link to that revision.

    • Settings Panel
      A new settings button (⋮) opens a floating panel with the two toggles. The panel is positioned above the main filter UI for easy access.

    Technical Improvements

    • UI Consolidation
      Reduced redundant code by streamlining the construction of filter buttons and status messages.

    • Event Handler Simplification
      Mouse hover effects for the collapse and settings buttons are now applied with minimal code.

    • Refactored Media Detection
      getBestMediaUrlFromPost now accepts a includeGifs parameter, centralising GIF inclusion logic.

    • Removed Unused Function
      Deleted getShortUrl() which was never called.

    • Cleaner Error Handling in API Requests
      Shortened error callbacks in GM_xmlhttpRequest for better readability.

    Bug Fixes

    • Revisions Toggle Properly Disabled on Coomer
      The revisions toggle is now greyed out and non‑functional on coomer domains where revisions are not supported.

    • State Reset on Page Navigation
      All video‑related counters and caches are correctly reset when changing pages, preventing stale data.

    • Settings Persistence
      New toggles are saved to localStorage and restored on page reload.

  • v1.2.3 2026-01-24

    Added Icon

  • v1.2.2 2026-01-24

    New Features

    1. Smart Thumbnail Retry System

      • Automatic retry for failed video thumbnails (max 3 attempts)
      • Configurable retry delay with exponential backoff
      • Video loading timeout protection (10 seconds)
      • Visual warning overlay for permanently failed thumbnails
    2. Fixed Media Priority Logic

      • Corrected priority order:
        1. Video in main file
        2. Video in attachments
        3. GIF in main file (only if no videos found)
        4. GIF in attachments (only if no videos found)

    Technical Improvements

    • Better Error Tracking: thumbnailRetryMap and failedThumbnails for managing retries
    • Video ID Tracking: Each video element gets unique ID for better state management
    • Cleaner Status Messages: Consolidated loading feedback to avoid spam
    • Proper State Reset: All tracking variables reset on page navigation

    Bug Fixes

    • Fixed incorrect media counting when posts contain both videos and GIFs
    • Corrected status message logic to match actual loaded content
    • Improved cleanup of video loading timeouts on page unload
  • v1.2.1 2026-01-22

    Should work on posts page now

    Fixed

    • Posts search page recognition: Updated the determinePageContext() function to properly detect and handle the /posts search page with query parameters (e.g., /posts?q=video)
    • Context handling: Added specific checks for:
      • Posts search with query: /posts?q=...
      • Posts search without query: /posts (shows all posts)
    • API URL construction: Ensured proper API endpoints are built for posts search:
  • v1.0.0 2026-01-22