Show HN: A bookmarklet to remove submissions and comments about ChatGPT from HN
So I made this bookmarklet to remove comments and posts about ChatGPT (including this one) from HN. Drag and drop the text below to your browser bar, give it a name like "Remove ChatGPT", and get rolling. Whenever you load submissions or a specific comment thread, just click the bookmarklet and the page will be ChatGPT (And even ChatGTP) free.
javascript:(function() {if (document.getElementsByClassName("comment-tree").length) { Array.from(document.getElementsByClassName("comtr")).filter(elt => elt.innerText.match(/chat\s?g[pt]{2}/i)).forEach(e => e.parentNode.removeChild(e)); } else { Array.from(document.getElementsByTagName("a")).filter(elt => elt.innerText.match(/chat\s?g[pt]{2}/i)).forEach(a => { const tr = a.parentNode.parentNode.parentNode; const table = tr.parentNode; const details = tr.nextSibling; const spacer = details.nextSibling; table.removeChild(tr); table.removeChild(details); table.removeChild(spacer);});}})();