i guess follow me @bethposting on bsky or pillowfort


discord username:
bethposting

cefqrn
@cefqrn

edit: if you're using versions 0.38 or 0.39 of this script or last updated/installed it between July 31st, 2023 and August 28th, 2023, there was a security vulnerability that was fixed in version 0.40 (warning post)

I tend to open a lot of tabs and a lot of the time it's to check out the comments of a post

scrolling tabs (motion)

horizontally scrolling tab bar with nothing but cohost tabs

so here's a userscript that lets you see a post's comments without opening it in a new tab

screenshot showing the userscript displaying comments under a post

click on the arrow to the left of the comment count to see the comments then click on it again to hide them

reopening the comments refreshes them

tested on both firefox and chrome with tampermonkey and also greasemonkey on firefox

source code

install

markdown isn't supported (yet?)

any and all suggestions are welcome

edits under the break (last update: 2023-11-23T01:26:45Z, version 0.48)


natatorialremnants
@natatorialremnants
This page's posts are visible only to users who are logged in.

You must log in to comment.

in reply to @cefqrn's post:

oh yeah I think @blep did something like that with the cohost plus userscript

but I gave up on trying to understand that then tried updating every time the document updated with a MutationObserver but couldn't get that to work because of the preloaded posts

so I just ended up checking all the posts every second

and

well

I mean it works

edit: it now uses a mutationobserver

is the entire thing not running (the black arrow in the image isn't appearing anywhere on the home page) or is it just not displaying the comments?

looking at the code I think the most recent thing it uses is Intl.RelativeTimeFormat which requires chrome 71+ or firefox 65+

but other than that, an error message from the console would be helpful in finding where it's breaking

the arrow is shown but it doesn't open up when I click on it. I get TypeError: /api/v1/trpc/posts.singlePost?batch=1&input={"0":{"handle":"shel","postId":1440645}} is not a valid URL. in the console instead

i'm using firefox

yeah currently it's just shoving the comment into an innerText
i'd planned on trying to parse a bit of it before i realized i'd also have to sanitize the input which aaaaa