Facebook Remove Suggested and Sponsored Posts (Beta)

Remove Suggested for You and Sponsored posts (Beta)

Stan na 30-10-2022. Zobacz najnowsza wersja.

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

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

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         Facebook Remove Suggested and Sponsored Posts (Beta)
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Remove Suggested for You and Sponsored posts (Beta)
// @author       Visualplastik
// @match        https://www.facebook.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @grant        none
// ==/UserScript==



function gtfo() {

    //Remove Suggested for You
    $( "span:contains('Suggested for you')" ).parent().parent().parent().parent().parent().hide().next().hide().next().hide().next().hide();

    document.querySelectorAll('svg').forEach((el) => {
        if(parseInt(el.style.width.replace('px','')) + parseInt(el.style.marginRight.replace('px','')) > 54) {
            console.log('ad found');
            el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove();
        }
    })
}

//Initial Run
setTimeout(function(){
    gtfo();
}, 3000);

//Repeat on Scroll
$( window ).scroll(function() {
  gtfo();
});