Skip to content

Instantly share code, notes, and snippets.

@gallais
Last active August 16, 2026 22:51
Show Gist options
  • Select an option

  • Save gallais/eca3fe5d40d8d9b3502b4ac272e9ef16 to your computer and use it in GitHub Desktop.

Select an option

Save gallais/eca3fe5d40d8d9b3502b4ac272e9ef16 to your computer and use it in GitHub Desktop.
Mediapart comment filter
// ==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