Requires: greasemonkey/tampermonkey/other script injector.

If your home instance is federated with instances you don’t want to see, you can use this script to remove all posts and comments from that instance without having to block communities individually.

Example:

Line 17: const blockedInstances = ["example.ml","lemmy.world"];

Will block:

user@lemmy.world posts to community@anyinstance.com

user@anyinstance.com posts to community@lemmy.world

user@lemmy.world comments on any post

Usage:

Edit the comma-seperated list on line 17 to the instances you wish to block. Add new ones inside quotes following a comma. Do not include https:// or trailing forward slashes in the instance text.

3 points

I truly hope the Lemmy devs start watching this community. So many great features that would be lovely added to the Lemmy code as user options.

permalink
report
reply
2 points

Sweet! Thanks this is a great use case. This could probably be pretty easily be built into the ui

permalink
report
reply
1 point

Yep I’m hoping we get more user-level control over the instances we see. This script is a naive client-side approach of just removing the HTML nodes of matching posts, but having it done on the server side would be ideal.

permalink
report
parent
reply
1 point
*

Wait, does the “block communities” feature in profile settings only block communities on the home instance? If so, that seems like a substantial opportunity for improvement.

permalink
report
reply
2 points
*

Nope it can block other instance’s communities. This script will block all posts at an instance level though, rather than having to keep adding blocked communities when people create more on that instance.

permalink
report
parent
reply
2 points

ah, gotcha. very nice

permalink
report
parent
reply
2 points

See my edit to the above comment, I misunderstood at first.

permalink
report
parent
reply

Lemmy Plugins and Userscripts

!plugins@sh.itjust.works

Create post

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!

Community stats

  • 1

    Monthly active users

  • 86

    Posts

  • 540

    Comments