FB Suggested Post Killer

Prevent adds in my post!

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         FB Suggested Post Killer
// @namespace    https://www.facebook.com/
// @version      1.2
// @description  Prevent adds in my post!
// @author       Eric Mintz
// @match        https://www.facebook.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // I predict FB will change this classname from time to time.
    // ... so I have it in an easy-to-access variable here at the top.

    // -----------------------------
    // -- change me as needed
    // -----------------------------
    var divClass="_5jmm";
    // -----------------------------

    // Your code here...
    var addListener = function(element,eventName,listener){
        if(element.addEventListener){
            element.addEventListener(eventName, listener);
        }else{
            element.attachEvent('on'+eventName, listener);
        }
    };
    var killads = function(){
        var divs = document.getElementsByClassName(divClass);
        for (var i = 0; i < divs.length; i++){
            var spans = divs[i].getElementsByTagName('span');
            if (spans.length > 0 && (spans[0].innerHTML == "Suggested Post" || spans[0].innerHTML == "Voorgesteld bericht")){
                divs[i].remove();
            }
        }
    };
    addListener(document,'load',killads);
    addListener(document,'DOMNodeInserted',killads);
})();