// ==UserScript==// @name Auto-Close Reply to Thread window when banned// @namespace http://tampermonkey.net/// @version 0.1// @description Automatically closes the quick reply window if "Error: You are banned." appears.// @match https://boards.4chan.org/*// @match http://boards.4chan.org/*// @run-at document-end// ==/UserScript==(function(){constobserveTarget=document.body;functioncheckAndClose(){constqr=document.querySelector("#qr");if(!qr)return;consterrorBox=qr.querySelector(".error");if(!errorBox)return;consttext=errorBox.textContent.trim();if(text.includes("Error: You are banned.")){constcloseBtn=document.getElementById("qrClose");if(closeBtn){closeBtn.click();}}}// Observe DOM for new error messages appearingconstobserver=newMutationObserver(checkAndClose);observer.observe(observeTarget,{childList:true,subtree:true});})();
Warning
LINK
You are about to visit a link which has been flagged with the above content warnings. Do you wish to continue?