Last active
August 16, 2026 22:51
-
-
Save gallais/eca3fe5d40d8d9b3502b4ac272e9ef16 to your computer and use it in GitHub Desktop.
Mediapart comment filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Mediapart comment filter | |
| // @version 1 | |
| // @match https://www.mediapart.fr/journal/*/commentaires | |
| // @grant none | |
| // ==/UserScript== | |
| // List of the blocked accounts' IDs | |
| const blocked = | |
| [ | |
| ]; | |
| (function() { | |
| const cmts = document.querySelectorAll('div[data-comment-id]'); | |
| cmts.forEach( (cmt) => { | |
| let uid = cmt.getAttribute('data-author-uid'); | |
| if (blocked.includes(uid)) { | |
| cmt.setAttribute('style', 'display: none'); | |
| } else { | |
| let link = cmt.querySelector('a[rel="author"]'); | |
| if (link) { | |
| let author = link.innerText; | |
| if (! author.includes('๐')) { | |
| link.innerHTML = author + " - ๐ " + uid; | |
| }; | |
| }; | |
| }; | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment