Skip to content

Instantly share code, notes, and snippets.

@SharlSherif
Created July 13, 2021 01:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save SharlSherif/51f3139c1071ddbf16826332a3bd2162 to your computer and use it in GitHub Desktop.
Hide Facebook Sponsored Posts
let ads = [...document.querySelectorAll("a")].filter(x=>x.textContent == "Sponsored")
for(let ad of ads){
let y = ad.parentElement
while(y.parentElement.querySelector(`[data-pagelet='FeedUnit_{n}']`) == null){
y=y.parentElement
}
y.style.display = "none";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment