Created
July 13, 2021 01:14
-
-
Save SharlSherif/51f3139c1071ddbf16826332a3bd2162 to your computer and use it in GitHub Desktop.
Hide Facebook Sponsored Posts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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