Edit: @[email protected] has designed a better solution using only CSS, and this should be used instead of the old script! If you’re reading this page for the first time, ignore this message.

This userstyle adds a red heart next to people that are from your home server, and any other servers that you manually define. Spot your server buddies out in the wild!

Instructions:

  1. Install Stylus extension for firefox/chrome

  2. “Write new style” in the addon settings

  3. Copy paste the CSS code below in

  4. Modify the code around line ~11 in order to reflect your homeserver and any additional frendservers that you want to highlight

  5. Modify the code around line ~19 to reflect your homeserver

  6. (Optional) If you’d like your homeserver buddies to have a different marker, uncomment the various sections around line ~27 through ~50 by removing the /* and */ bits

  7. (Optional) Play around with different markers and colors!

CSS/Userstyle: https://gist.github.com/redyoshi49q/f1b2d1da0a8f7536aba1f8c3110d2dd8

    • Yote.zip@pawb.socialOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 years ago

      Yeah, tampermonkey, violentmonkey, greasemonkey, whatever sort of userscript manager you’ve got!

        • mershed_perderdersM
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          2 years ago

          you’ll need to rewrite the @match https://pawb.social/* to work on all lemmy servers:

          @match https://*/c/*

          • Yote.zip@pawb.socialOP
            link
            fedilink
            English
            arrow-up
            4
            ·
            2 years ago

            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)

            • GodM
              link
              fedilink
              English
              arrow-up
              2
              ·
              2 years ago

              The way I’ve done mine is to detect universally if it’s a lemmy instance, and if it is, run. Otherwise just return.

              • Yote.zip@pawb.socialOP
                link
                fedilink
                English
                arrow-up
                1
                ·
                edit-2
                2 years ago

                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.

                • GodM
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  2 years ago

                  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

            • Yote.zip@pawb.socialOP
              link
              fedilink
              English
              arrow-up
              2
              ·
              2 years ago

              In its current iteration, the @match line needs to be switched to say @match https://sh.itjust.works/* for you.

  • JohnEdwa@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    This is pretty neat. I personally modified it to display the Finnish flag emoji as my home instance is for the most part meant for Finns :)

  • GodM
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    2 years ago

    pawb.social is refederated again, so all goes back to normal for now :) pay no mind to this comment and enjoy your stay.

    original comment

    Important

    pawb.social, the instance OP is from, was sadly defederated from sh.itjust.works. This means they cannot edit this post or respond to your comments.

    This is the link where it is currently being maintained: https://pawb.social/post/43513

    ## Author’s message on his Greasyfork extension:

    (In this case, SJW means shit.just.works)

    Strange times we live in. My instance (pawb.social) has defederated from sh.itjust.works due to their open signup/spambot/trolling problem. This means I can’t actually manage the OP post about this userscript I made, and the link to this page is still alive and prominent for SJW users. It’s unfortunate, but I understand the rationale. I think it will just be temporary until SJW moderates their instance better. This userscript has actually been replaced by a userstyle version, which does the same thing in a cleaner way.

    The version of my post that contains the updated userstyle and instructions is located here: https://pawb.social/post/43513

    This is the same exact post that you probably came from, but the difference is it’s hosted on pawb.social, and therefore I can edit it. My edits on pawb.social do not get pushed to SJW since we are defederated. It’s sort of like being shadowbanned. In the meantime though, this ‘shadowbanned’ post still works as a homepage, as long as it’s linked to directly on pawb.social!

    Apologies for the inconvenience, we’re exploring lemmy’s quirks together!

    • Yote.zip@pawb.socialOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      2 years ago

      Thank you for posting this! As luck would have it, we literally just re-federated to SJW after a discussion: https://pawb.social/post/69478

      Here’s hoping that defederation remains a nuclear option, because this was a bit of a confusing experience.

      Edit: Also (if we were still defederated) I actually can reply to comments from other instance’s users on this post (I did so here while we were defederated). SJW users will not see my comments, but they will get distributed properly to members of other instances. I wouldn’t be able to reply to SJW posts if we were still defederated though.

      • GodM
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        2 years ago

        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.

        • Yote.zip@pawb.socialOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 years ago

          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.

          • GodM
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            2 years ago

            :) 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)

            • Yote.zip@pawb.socialOP
              link
              fedilink
              English
              arrow-up
              3
              ·
              2 years ago

              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.

      • Yote.zip@pawb.socialOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        You’re correct. comments between other instances still propagate successfully but direct interaction is not allowed. Pawb.social did just overturn its defederation of SJW, so we’re back to normal for the meantime. I’m glad to have seen this happen early on though, it’s good to know about the effects of this type of situation, and what that means for the future

        • JohnEdwa@sopuli.xyz
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 years ago

          Another interesting consequence is that deletions don’t propagate either. sopuli.xyz and sh.itjust.works both agree it’s deleted, pawb doesn’t so you were able to reply to it. Not that it really matters in this case as the reason was not being sure which way the defederation was actually done, but it’s something to keep in mind when posting stuff here, just like the email comparison people have been using about the fediverse, once you hit send it’s out of your control.

          • Yote.zip@pawb.socialOP
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 years ago

            Yeah I’m not sure if there’s like a “refederation queue” that is taking place to sync everything up asynchronously since we literally just hit the redeferate button half an hour ago, but my OP on this page was not the correctly synchronized version either. I had to click edit and resubmit it, which pushed a proper update event.

            Events that took place during the defederation period are still a bit wacky. One of my replies from the defederation period did get synced to SJW by itself, but my own personal upvote of the post did not (showed 0 points). After un-upvoting and upvoting again, it properly showed 1 point on SJW

    • Yote.zip@pawb.socialOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      2 years ago

      SO. Strange times we live in. I believe how this works is that everyone except sh.itjust.works users will see this reply I’m writing. My instance (pawb.social) has defederated from sh.itjust.works due to their open signup/spambot/trolling problem. This means I can’t actually manage the OP post I made anymore. It’s unfortunate, but I understand the rationale. I think it will just be temporary until SJW moderates their instance better.

      I only recently realized this defederation happened, so I had thought that deleting the userscript wasn’t a problem because the userstyle now supersedes it with full parity. Interestingly enough, I had actually been updating the post the whole time, but defederation means no one can see those updates. They do still live in our pawb.social copy though, so by visiting this post you can actually see a version of this page with the newest updates. I’ll also put the userscript back up with a redirection note in the meantime.

      TL;DR: Script now lives here!: https://pawb.social/post/43513