Skip to content

Instantly share code, notes, and snippets.

@winkler1
Last active November 30, 2022 20:15
Show Gist options
  • Save winkler1/f390930f4306eb6ca565f5bd675dd460 to your computer and use it in GitHub Desktop.
Save winkler1/f390930f4306eb6ca565f5bd675dd460 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name No Doohickey
// @include https://post.news/*
// ==/UserScript==
var EVIL = "Can y’all repost this post to let folks know I’m on this dohicky";
var regex = RegExp( EVIL + "\\?","mg");
function makeItStop() {
for (let kid of document.getElementsByTagName("p")) {
var newHTML = kid.innerHTML;
if (newHTML.indexOf(EVIL) > -1) {
kid.innerHTML = newHTML.replace(regex, "[CENSORED]");
}
}
// Low-rent way of dealing with Infinite Scroll
setTimeout(makeItStop, 1000);
}
(function()
{
setTimeout(makeItStop, 1000); // Next hydration timing is funky.
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment