您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Makes sponsored feeds invisible on facebook.com
当前为
// ==UserScript== // @name Facebook no ads // @namespace http://tampermonkey.net/ // @version 0.5 // @description Makes sponsored feeds invisible on facebook.com // @author Darmikon // @match https://www.facebook.com/* // @grant none // ==/UserScript== const throttle = (func, limit) => { let inThrottle return function() { const args = arguments const context = this if (!inThrottle) { func.apply(context, args) inThrottle = true setTimeout(() => inThrottle = false, limit) } } } const trimAds = () => { const feeds = document.getElementById('contentArea').querySelectorAll('[id*=hyperfeed_story_id]'); feeds.forEach(feed => { try { const title = feed .querySelector('[data-testid*="story"]'); // feed_subtitle_263;376364045765261;0;2201380379930276;1552581075:5551613536253095581:5:0:11326 const id = title.id || ''; const hackSpace = id.split(';')[2]; const detectAdsCondition = !title.id || hackSpace == 0; if(detectAdsCondition) { // console.log('killed', title); feed.style.display = "none"; } } catch (e) {} }); } (function() { const throttleKill = throttle(trimAds, 1000); throttleKill(); window.addEventListener('scroll', throttleKill); window.addEventListener('resize', throttleKill); })();