Made a script to hide post with less than N number of replies, enjoy :)
// ==UserScript==
// @name Hide 4chan threads with fewer than 10 replies
// @match https://boards.4chan.org/*/catalog*
// @match https://boards.4channel.org/*/catalog*
// @run-at document-idle
// @grant none
// ==/UserScript==
(() => {
const MIN_REPLIES = 10;
const HIDDEN_CLASS = 'hidden-by-reply-count';
const style = document.createElement('style');
style.textContent = `.${HIDDEN_CLASS} { display: none !important; }`;
document.head.appendChild(style);
function getReplyCount(thread) {
// Пepвый в .meta — кoличecтвo oтвeтoв R.
const replies = thread.querySelector('.meta b, .txt-rep');
const count = Number.parseInt(replies?.textContent ?? '', 10);
return Number.isFinite(count) ? count : NaN;
}
function apply() {
document
.querySelectorAll(
'#threads > .thread, #threads tr[id^="thread-"], .catalog-thread'
)
.forEach(thread => {
const replies = getReplyCount(thread);
if (Number.isFinite(replies)) {
thread.classList.toggle(
HIDDEN_CLASS,
replies < MIN_REPLIES
);
}
});
}
let queued = false;
function scheduleApply() {
if (queued) return;
queued = true;
requestAnimationFrame(() => {
queued = false;
apply();
});
}
apply();
new MutationObserver(scheduleApply).observe(document.body, {
childList: true,
subtree: true
});
})();