Facebook AdBlock

Elimina la publicidad de Facebook

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Facebook AdBlock
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  Elimina la publicidad de Facebook
// @author       Leg-ion
// @match        https://www.facebook.com/*
// @require      http://code.jquery.com/jquery-3.4.1.min.js
// @grant        none
// ==/UserScript==

var publicidad = ['The Jerry Can Bar Europe','Amazon Flex España','StarVegas','Halls','Secretos De Mezcla','888casino'];
var pos;

const trimAds = () => {

    var feeds = document.getElementById('contentArea').querySelectorAll('[id*=hyperfeed_story_id]');
    for (var i = 0; i < feeds.length; i++)
    {
        var hs = feeds[i].getElementsByTagName("h5");
        var as = hs[0].getElementsByTagName("a");
        for (var j = 0; j < publicidad.length; j++)
        {
            pos = as[0].innerHTML.indexOf(publicidad[j]);
            if (pos != -1)
            {
                feeds[i].style.display = "none";
                break;
            }
        }
    }
}

(function() {
    window.addEventListener('scroll', () => {
        setTimeout(trimAds, 1000);
    });
})();