Fix: eradicate stories for non-english versions of fb #256
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the bug where stories were not eradicated for users who are not using english version of FB
As discovered in #216 aria-label is being translated if user is using fb in other languages, so the selectors were not eradicating stories container for them.
I chose to target the stories container with
div[role='region'][data-visualcompletion='ignore-dynamic']
which is not perfect but there was no other way to distinguish it from other elements except for targeting the ridiculous auto-generated class namex1n2onr6 x121yvx8 xjkvuk6 xieb3on x9otpla x1iorvi4
and i don't know which would be worse.The idea of targeting it in js like Eason did in #216 unfortunately does not work consistently because divs with
[role=region]
seem to be loading in different order and and in variable quantity, so sometimes the selector would match some unrelated element.It works for me, tested it on chrome on various languages.