https://github.com/phpmacher/mastodon-hide-interacted-posts
A Tampermonkey script that hides posts, the user already interacted with
https://github.com/phpmacher/mastodon-hide-interacted-posts
fediverse greasemonkey greasemonkey-script greasemonkey-userscript mastodon opensource socialmediatools tampermonkey tampermonkey-userscript userscript userscripts
Last synced: about 1 month ago
JSON representation
A Tampermonkey script that hides posts, the user already interacted with
- Host: GitHub
- URL: https://github.com/phpmacher/mastodon-hide-interacted-posts
- Owner: phpmacher
- License: mit
- Created: 2025-06-28T14:09:30.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-28T14:30:50.000Z (11 months ago)
- Last Synced: 2025-06-28T15:29:10.145Z (11 months ago)
- Topics: fediverse, greasemonkey, greasemonkey-script, greasemonkey-userscript, mastodon, opensource, socialmediatools, tampermonkey, tampermonkey-userscript, userscript, userscripts
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mastodon Hide Interacted Posts (Toggleable)
This userscript hides all Mastodon posts that you've **already liked or boosted**, to help reduce visual clutter in your timeline.\
The behavior is **toggleable via a floating button** in the UI, and the setting is remembered across sessions.
If the feature is switched to ON, the posts are hidden after 4,5s.
---
## ๐งน Features
- Automatically hides posts you've liked โญ or boosted โป๏ธ
- Adds a small floating toggle in the bottom-right corner
- Persists your ON/OFF setting using localStorage
- Debug-friendly styling before hiding (orange dashed border)
- Works on `sueden.social`, `mastodon.social`, and any `*.social` instance
---
## ๐ธ Screenshots
Toggle the feature on and off:

Example of a marked post:

---
## โ๏ธ How It Works
The script observes all `.status` elements and checks whether:
- The post was **liked** (button with `.star-icon.active`)
- The post was **boosted** (button with `title` or `aria-label` like *"Beitrag nicht mehr teilen"* or *"Unboost"*)
If either is true, the surrounding `` element is marked and eventually hidden.\
It uses `MutationObserver` to work with infinite scrolling.
---
## ๐ก๏ธ Toggle Behavior
A small button appears in the bottom-right corner:
| State | Appearance |
| ----------- | ------------------------------------- |
| ON (active) | Blue button: `Interacted-Hiding: ON` |
| OFF | Gray button: `Interacted-Hiding: OFF` |
Click the button to toggle the hiding logic.
---
## โฑ๏ธ Delay Before Hiding
To help with debugging and testing, there's a short delay (default: 4.5 seconds) before a post gets hidden.\
This gives you time to verify that the detection worked.
```ts
const HIDE_DELAY_MS = 4500;
```
---
## ๐ป Installation
Install via [Tampermonkey](https://www.tampermonkey.net/) or a compatible userscript manager.
- [Install this script from GitHub](https://github.com/phpmacher/mastodon-hide-interacted-posts/raw/main/mastodon-hide-interacted-posts.user.js)
---
## ๐ ๏ธ Customization
You can easily adjust the `HIDE_DELAY_MS` constant in the script if you prefer instant hiding.
```ts
const HIDE_DELAY_MS = 4500;
```
---
## ๐ License
MIT โ free to use, modify, share. โ see the [LICENSE](LICENSE) file for details.
---
## ๐ Author
[@phpmacher](https://sueden.social/@phpmacher)
---
## Contributions
Please feel free to submit issues or pull requests if you'd like to improve the script.