fuck reels

31/03/2025, 05:51:04

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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 });
}