UpYoursFB

Hide Facebook Ads

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        UpYoursFB
// @namespace   upyoursfb
// @description Hide Facebook Ads
// @author      d4rk3rnigh7
// @include     *://*.facebook.com/*
// @require     https://code.jquery.com/jquery-3.2.1.min.js
// @version     1.9.3
// @license     CC
// @grant       none
// ==/UserScript==

$(document).ready(function(){
    var upyours = ['Suggested Offer', 'Suggested Post', 'Featured For You', 'A Video You May Like'];
    $(document).on('scroll', function(){
        // For Desktop
        if(window.location.href.indexOf('www.facebook') !== -1){
            $('span').each(function(){
                if($.inArray($(this).text(), upyours) !== -1){
                    $(this).parents().eq(4).hide();
                    //console.log('Got another one | Up yours fb');
                }
            });
        }
        // For Mobile
        else{
            $('header').each(function(){
                if($.inArray($(this).text(), upyours) !== -1){
                    $(this).parents().eq(1).hide();
                    //console.log('Got another one | Up yours fb');
                }
            });
        }
    });
});