Faphouse-HideWatched

Removes watched videos from the feed. The next unwatched video takes it place so there are no obvious side-effects.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Faphouse-HideWatched
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Removes watched videos from the feed. The next unwatched video takes it place so there are no obvious side-effects.
// @author       echo17
// @match        *://*.faphouse.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to find and remove the watched elements
    function removeWatchedVideos() {
        // Find all spans with the specific class
        const watchedSpans = document.querySelectorAll('span.t-vw');

        watchedSpans.forEach(span => {
            // Verify the text says "Watched" just to be safe
            if (span.textContent.trim() === 'Watched') {
                // Traverse up the DOM tree to find the main container div
                const parentDiv = span.closest('.thumb');

                // If the parent is found, remove it from the page
                if (parentDiv) {
                    parentDiv.remove();
                }
            }
        });
    }

    // 1. Run once on initial page load
    removeWatchedVideos();

    // 2. Set up a MutationObserver to handle dynamically loaded content (infinite scrolling)
    const observer = new MutationObserver((mutations) => {
        for (const mutation of mutations) {
            if (mutation.addedNodes.length > 0) {
                removeWatchedVideos();
            }
        }
    });

    // Start observing the document body for newly added HTML
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();