Skip to content

Instantly share code, notes, and snippets.

@mattolenik
Created February 14, 2023 20:25
Show Gist options
  • Save mattolenik/cdd6277061e3025d65d53fd62f58ff1f to your computer and use it in GitHub Desktop.
Save mattolenik/cdd6277061e3025d65d53fd62f58ff1f to your computer and use it in GitHub Desktop.
Greasemonkey script to hide Facebook ads and BS, tested Feb 2023
// ==UserScript==
// @name Hide "Suggested post" on Facebook
// @include https://www.facebook.com/*
// @grant none
// ==/UserScript==
(function(){
var watcher = function(){
var bs=[...document.querySelectorAll('div[role="main"] div[data-pagelet="FeedUnit_{n}"]')].filter(div => div.innerHTML.includes('Suggested for you')).forEach(el => el.remove())
setTimeout(watcher, 200);
};
watcher();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment