this post was submitted on 14 Jun 2023
14 points (93.8% liked)
Lemmy Plugins and Userscripts
2175 readers
1 users here now
A general repository for user scripts and plugins used to enhance the Lemmy browsing experience.
Post (or cross-post) your favorite Lemmy enhancements here!
General posting suggestions:
- Preface the submission with the type of enhancement - ex: [UserScript].
- Include a screenshot of the enhancement in use (where possible)
- Indicate the requirements for use (eg, greasemonkey, stylus, etc.)
Thanks!
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You just need to rewrite it so the first part matches your homeserver I think.
There are many url schemes that potential usernames can show up on, e.g. /c/, /post/, /comment/, /u/, and worst of all, any top level site like https://pawb.social/ or https://google.com/ could be a lemmy front-page with usernames on it. Instead of running the userscript on every website you visit and then checking if we were on lemmy afterwards, I thought it was just easier to only run on your personal homeserver, which is where you should generally always be anyway (if I understand lemmy UX correctly)
yeah, that makes sense.
The way I've done mine is to detect universally if it's a lemmy instance, and if it is, run. Otherwise just return.
Yeah, that's definitely an option, but then the script will have to check on every website you visit. Practically it's not a problem but it feels a little weird. If there's a good reason to run this script on foreign lemmy servers it's not a problem to change to that style, but for right now I didn't see a reason to make it global.
when i install it i'll just make it run globally, i see no reason why not x) i'm always visiting all the instances anyway cuz it's better that way for now until better fedtools come out
I've made some updates to this script and fixed a bug - was not expecting the way that lemmy lazy-loads stuff later in the page lifespan. Now it works globally and the internals are set up to handle that properly.
https://greasyfork.org/en/scripts/468689-frend-detector-lemmy
i'm trying it out and it doesn't seem to do anything, at least here
Did you edit the variables at the top of the script? It no longer assumes your homeserver, since it works globally.
I put in
sh.itjust.works
as the homeserver and this is the view from sh.itjust.works server:and this is the view from pawb.social side (identical):
Edit: Also, at least in my experience I had to refresh old pages once or twice before the new script would start working. Try a few new tabs and see if that fixes it.
https://**/*
, idk what that does but it matches.weird. the screenshots I took were with the normal match - I'm using violentmonkey so maybe they have different match behavior? Does
https://*/*
work? I may just change the default to that if it doesn't matter either wayhmmm seems to work now?? idk what happened before. (using
https://*/*
)