Greasy Fork is available in English.

Remove Facebook "Suggested for You" and "Reels"

Dynamically removes "Removed suggested for You" and "Removed reels" elements on Facebook

// ==UserScript==
// @name         Remove Facebook "Suggested for You" and "Reels"
// @namespace    -
// @version      1.1
// @description  Dynamically removes "Removed suggested for You" and "Removed reels" elements on Facebook
// @author       jamescasipong
// @match        https://www.facebook.com/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // Function to remove elements based on text content
    function removeElementsByText(textArray) {
        textArray.forEach((text) => {
            const elements = Array.from(document.querySelectorAll('div'))
                .filter(el => el.textContent.trim().toLowerCase().includes(text.toLowerCase()));
            elements.forEach(element => element.remove());
        });
    }

    // Initialize MutationObserver
    const observer = new MutationObserver(() => {
        removeElementsByText([
            "removed suggested for you",
            "removed reels"
        ]);
    });

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

    // Initial cleanup on page load
    removeElementsByText([
        "removed suggested for you",
        "removed reels"
    ]);
})();