Eporner – Hide Watched Videos

Hide or grayscale already watched videos on eporner.com

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Eporner – Hide Watched Videos
// @namespace    http://tampermonkey.net/
// @version      1.1.0
// @description  Hide or grayscale already watched videos on eporner.com
// @author       orgacord
// @match        https://www.eporner.com/*
// @grant        none
// @license      MIT
// ==/UserScript==
(function() {
    'use strict';

    /**
     * CONFIGURATION
     * Choose how watched videos are treated:
     * "hide"      → completely remove them from the grid
     * "grayscale" → keep them visible but dimmed
     */
    const HIDE_MODE = "grayscale";

    const hiddenSet = new WeakSet();

    function hideWatched() {
        let count = 0;
        document.querySelectorAll('.mb').forEach(thumb => {
            if (hiddenSet.has(thumb)) return;

            const watchedIcon = thumb.querySelector('i[title^="Watched"]');
            if (watchedIcon) {
                if (HIDE_MODE === "hide") {
                    thumb.style.display = 'none';
                } else {
                    thumb.style.filter = 'grayscale(100%)';
                    thumb.style.opacity = '0.5';
                }
                hiddenSet.add(thumb);
                count++;
            }
        });

        if (count > 0) {
            console.log(`Processed ${count} watched video(s)`);
        }
    }


    hideWatched();

    const observer = new MutationObserver(hideWatched);
    observer.observe(document.body, { childList: true, subtree: true });
})();