jordwest / news-feed-eradicator

A browser extension that deletes your news feed and replaces it with a nice quote
MIT License
1.2k stars 283 forks source link

Fix FB Q4 2022 (#232) #244

Closed nzawirski closed 1 year ago

nzawirski commented 1 year ago

I noticed that seemingly arbitrary classnames are (hopefully) consistent so we can target them directly. This fixes the eradicator on new fb layout introduced in october/november this year

barmac commented 1 year ago

I can confirm this fixes the issue. Too bad there seem to be no attributes in the DOM which could make the solution more stable. Thanks for looking into this! :)

jordwest commented 1 year ago

Thanks for the PR. I was really hoping to avoid using those selectors as they're likely hashed based on the CSS content, so they'll change as soon as FB experiments with changing styles on the feed, but maybe it's all we have at the moment.

nzawirski commented 1 year ago

Thank you for merging. Yeah, i'm also not super happy with this solution but i figured it's better than nothing. The only distinctive feature in DOM that could have been used to target the feed i think is the div[role='main'] or something like that. But the actual element we want is buried deep inside it and sometimes it's even not the first child of it's parent, so the selector would be a complex string of div div div ~ div... and so on, and that probably wouldn't even be that much better of a solution.

I wanted to experiment with it a bit more more but curiously, my layout switched back to the old one so i had no way of doing that. ( Btw i was in different location this weekend so maybe FB gives the new layout to people based on their location? ) I guess we'll have to just stick to what we have while it works and see what FB throws at us next.