// ==UserScript==
// @name         4chan shift-click to hide
// @namespace    https://4chan.org/
// @version      0.1
// @description  Shift-click on a post so you don't have to see it
// @author       You
// @match        https://boards.4chan.org/*/thread/*
// @match        https://boards.4channel.org/*/thread/*
// @grant        none
// ==/UserScript==

// Bookmarklet to remove hidden posts, if you wanted to save the thread locally. Only effective when the page doesn't update anymore.
// javascript:document.querySelectorAll("div.postContainer.post-hidden, div.postContainer:has(div.post-hidden)").forEach((el) => el.remove())

(function() {
    'use strict';

    var thread = document.getElementsByClassName("thread")[0];

    function thread_event_listener(event)
    {
        if (!event.shiftKey)
            return;

        var post = event.target.closest(".postContainer");
        var postid = post.getAttribute("id").substr(2);
        ReplyHiding.toggle(postid);
        document.getSelection().removeAllRanges();
    }

    thread.addEventListener("click", thread_event_listener);
})();
Edit

Pub: 09 Mar 2024 12:11 UTC

Views: 3598