Skip to content

Instantly share code, notes, and snippets.

@todb
Created January 19, 2024 17:29
Show Gist options
  • Select an option

  • Save todb/35aa059ef2a94cb86a2db63e5121ddeb to your computer and use it in GitHub Desktop.

Select an option

Save todb/35aa059ef2a94cb86a2db63e5121ddeb to your computer and use it in GitHub Desktop.
Javascript Bookmarklet to replace the cat's name in Rats in the Walls
// Run the below in the developer console while on
// https://www.hplovecraft.com/writings/texts/fiction/rw.aspx
// or, save it as a bookmarklet and run it that way.
// Exactly how bookmarklets work for you is browser specific.
// Feel free to drop your own cat's name into newCatName, below.
// Wonder why I wrote this? Go to https://podsothoth.club and listen
// to espisodes 43 and 44 to find out!
(function() {
const newCatName = 'Mephistopheles';
var elements = document.body.getElementsByTagName("*");
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
element.innerHTML = element.innerHTML.replace(/Ni[\x67]{2}er-Man/g, newCatName);
}
})();
@todb
Copy link
Copy Markdown
Author

todb commented Jan 19, 2024

In my browser, Vivaldi, the results look like this, after pasting the above into the console that's opened under Tools -> Developer Tools -> Console.

Browser window open to Rats in the Walls text, with a replaced cat name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment