this post was submitted on 14 Jun 2023
1 points (100.0% liked)
Lemmy Plugins and Userscripts
2154 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
ah, nice to know! :) Thanks, and I'm super glad to have you back. I've actually been using your script (version 1.3) as a basis for another plugin I'm making. I'm not sure it'll see the light of day but it's fun, and it's my first attempt at a firefox extension.
Very cool! I'm not a web developer by trade so don't take anything I wrote as good design, but the mutation observer + disconnect/reconnect paradigm seems like a good way to generically interact with lemmy. I tried to monitor for normal DOM/etc events and couldn't find any that happened when lemmy moved stuff around, so this is the only way I could find.
:) ChatGPT had actually given me the observer syntax, I used it for the first plugin on the community 😎😎 ChatGPT made most of it too hahah. It's simple enough.
I am actually a professional web developer. But that doesn't mean I'm amazing at it, though I do know a few... practices, not sure if I should call them "best practices" or even "good design" hahahah, I just do what it takes.
I switched the whole thing to typescript though which tends to produce better results for complex things. Typechecking at compile time saves a shitton of debugging time. For the rest of things like the addon folder structure, dependencies and anything else, I just ask ChatGPT. It is now my universal encyclopedia! 🥸 (encyclopedia, assistant, codemonkey, proofreader, second brain for when mine turns off and also my new source of type errors cuz its common sense is sometimes nonexistent)
Strongly typed languages are definitely my jam. Develop slightly slower, debug 2x less, faster runtime. What's not to like. Kudos for actually being a web developer - it makes my head hurt. Case in point: me writing all this complicated JS when the problem was cleanly solvable with attribute selectors in CSS. I'm technically fullstack but I mostly stay backend and application-level if I can help it. Web dev has too many options for how to accomplish something, and I never know what the proper answer is. I'm interested to see what general paradigm people will use to interact with lemmy - I feel there has to be a more efficient way than mutation observer. Lemmy's HTML markup could stand to be more verbose as well - extra classes to hook onto for more precise manipulation.