How I got rid of the new sponsored #facebook posts.
▻https://hackernoon.com/how-i-get-rid-of-the-new-sponsored-facebook-posts-138d013f4bbe?source=rs
Disclaimer: This story is focused on how I identified and removed the sponsored posts, not on why I removed them. It’s an occasion to learn more about the DOM.Today I open Facebook, and I notice something, my adblocker isn’t working.As a developer, I decided to investigate, and first thing first I inspect the structure of these sponsored posts, to see if there’s a way to identify them so I can remove them with a script.The structure looks pretty simple, we have an element with role “article”, that contains a div with a class starting with “feed_subtitle”, and inside this last div, something like a bazillion of spans with random words.Dude, seriously, WTF?Facebook madness…They are using a trick to display the word “Sponsored”: some of the spans are visible, some aren’t.And to make things simpler… (...)