Skip to content

Instantly share code, notes, and snippets.

@DarkGuardsman
Created October 9, 2019 15:28
Show Gist options
  • Save DarkGuardsman/300c41e50a1edeb878e45d79ab48912c to your computer and use it in GitHub Desktop.
Save DarkGuardsman/300c41e50a1edeb878e45d79ab48912c to your computer and use it in GitHub Desktop.
Chrome javascript snippet for strip all text from page
var body = document.getElementsByTagName("body")[0];
var iter = document.createNodeIterator (body, NodeFilter.SHOW_TEXT);
var textnode;
while (textnode = iter.nextNode()) {
if(textnode.wholeText.trim() !== '') {
textnode.nodeValue = '1';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment