-
Notifications
You must be signed in to change notification settings - Fork 44
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
Enhancement: PostBlock blocks instantly. #898
base: master
Are you sure you want to change the base?
Enhancement: PostBlock blocks instantly. #898
Conversation
384e6af
to
713c54b
Compare
Now using CSS selectors instead of directly adding/removing classes as suggested here. |
0de226f
to
384e6af
Compare
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.
The GitHub review UI apparently doesn't let me make a code suggestion when there's a CI warning in the "files changed" interface, but as per that warning, you can combine the two imports from the same file.
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.
postblock.css
can be removed as part of this, as it is no longer used! Addtionally:
async (postElement) => { | ||
const { rebloggedRootId } = await timelineObject(postElement); | ||
const rootID = rebloggedRootId || postElement.dataset.id; | ||
postElement.dataset.targetRootId = rootID; |
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.
These need to be removed in clean()
!
const styleElement = buildStyle(); | ||
const buildCss = () => | ||
`:is(${blockedPostRootIDs | ||
.map((rootId) => `[data-target-root-id="${rootId}"]`) |
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.
Here we should target the article
elements within the post elements, not the post elements themselves, to avoid breaking J/K scrolling.
Description
Addresses issue #894 reported by @marcustyphoon by using the same caching as Seen Posts to block posts during soft navigation.
Testing steps
Enable PostBlock script and use as normal.