fuck reels

31/03/2025, 05:51:04

// ==UserScript==
// @name        fuck reels
// @namespace   Violentmonkey Scripts
// @match       https://www.facebook.com/*
// @grant       none
// @version     1.0
// @author      -
// @description 31/03/2025, 05:51:04
// ==/UserScript==
function findAndDeleteReels() {
    const spans = document.querySelectorAll("div > div > div > div > div > div > div > div > div > div > div > span");
    const found = Array.from(spans).find(span => span.textContent.includes("Reels"));

    if (found) {
        console.log("Found:", found);

        let parent = found;
        let depth = 0;

        while (parent.parentElement && depth < 23) {
            parent = parent.parentElement;
            depth++;
        }

        if (depth === 23 && parent.parentElement) {
            console.log("Deleting parent 23:", parent);
            parent.remove(); // Remove the 23rd parent element
            return true;
        } else {
            console.log("Parent 23 does not exist.");
        }
    }
    return false;
}

if (!findAndDeleteReels()) {
    console.log("Not found initially, starting observer...");

    const observer = new MutationObserver(() => {
        if (findAndDeleteReels()) {
            console.log("Found dynamically, stopping observer.");
            observer.disconnect();
        }
    });

    observer.observe(document.body, { childList: true, subtree: true });
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址