[Userscript] Add hearts to users from your homeserver/other designated servers (Frend Detector) v1.4

Yote.zip@pawb.social to Lemmy Plugins & Userscripts@sh.itjust.works – 1 points –

This userscript 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!

Fair warning: Lemmy's html structure doesn't seem conducive to filtering what links are what, so if anyone more experienced has any tips on improvements to the detection methods, let me know!

Instructions:

  1. Change the 'homeServer' variable at the top to your home server (no "https://" etc)
  2. If you want to designate other servers to put hearts next to, add their names into the 'frendServers' variable at the top (Remove the '//' symbols inside the variable's brackets in order for the servers to actually be considered

Script: https://greasyfork.org/en/scripts/468689-frend-detector-lemmy

Edit: Alternatively, redyoshi49q@furry.engineer wrote a CSS solution that works as long as you're not navigating a foreign instance (on a different URL than your home server). If you find yourself on other instances for some reason, use my script, otherwise the CSS version should be better.

Userstyle:

/* ==UserStyle==
@name           Frend Detector (CSS)
@namespace      redyoshi49q/frendDetector
@version        1.0.0
@description    Puts a heart next to frends from your homeserver and any manually-defined frend servers
@author         @redyoshi49q@furry.engineer
==/UserStyle== */

@-moz-document domain("pawb.social") { /* change to your home server here */
    /* frend server user highlighting */
    a.text-info[href*="/u/"][href$="@pawb.fun"] span::before,
    a.text-info[href*="/u/"][href$="@furry.engineer"] span::before {
        content: "❤ ";
        color: red !important;
    }

    /* home server user highlighting */
    a.text-info[href*="/u/"]:not([href*="@"]) span::before {
        content: "❤ ";
        color: red !important;
        /* uncomment to make home server users have a yellow star instead */
        /* content: "★ ";
        color: yellow !important; */
    }
}
0

No comments yet. You could be first!