-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eradicate story at Facebook #216
base: master
Are you sure you want to change the base?
Conversation
Big thanks for you @EasonC13! |
let story = document.querySelector('[role=region]') | ||
if (story == null) { | ||
return | ||
} | ||
|
||
// Hidden all story feeds | ||
for (let i = 0; i < story.children[1].children[0].children.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a better idea to target the stories container with div[aria-label='Stories']
selector instead. That would remove the need for the for loop
if (i == 0) { | ||
continue | ||
} | ||
let child = story.children[1].children[0].children[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can typecast this as HTMLElement to make typescript shut up about style not being property of Element
let child = story.children[1].children[0].children[i] as HTMLElement;
let child = story.children[1].children[0].children[i] | ||
// Make others' story invisible and unclickable | ||
// @ts-ignore | ||
child.style.opacity = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opacity value should be a string so = '0'
From what i see the stories are already being hidden using css by targeting their container with Your solution is ok tho. I added some comments for the curious. But since this issue is already taken care of in css, i'm not sure if there is a need to merge this code. |
@nzawirski - so I'm afraid not really feasible for selecting elements by it multilang 🥲 Would love to see it fixed and deployed though! |
@pawel-tomkiel oh wow, thanks for pointing it out, i totally didn't think that it could be the issue. In that case the way Eason solved it is better. I'm only thinking that maybe it would be better to target it in css instead of js, the same way other containers are targeted 🤔 I'll try to come up with a solution to this this evening. |
Thank you. |
Ok so i messed around a bit and found that targeting it in js does not work consistently. Although targeting it in css is a pain as well. I submitted a new PR #256 with updated solution. @EasonC13 @pawel-tomkiel i tagged you as co-authors since it was your work that helped create this solution. Ultimately it's up to @jordwest to review and merge these changes. |
As the image shows, I add some codes to allow the news-feed-eradicator to remove story feeds from friends at Facebook. That is very distracting when I just want to go to Facebook to view notifications.
P.S. My PR may require some extra work to make it more TypeScript, as I don't know TypeScript very well, I simply use
// @ts-ignore
to ignore type errors.