Create a gist now

Instantly share code, notes, and snippets.

Replaces all text on a page with the font size. Useful for debugging the page or just replacing wretched content with something less awful.
javascript:%28function%28%29%7Bvar%20n,walk=document.createTreeWalker%28document.body,NodeFilter.SHOW_TEXT,null,0%29%3Bwhile%28n=walk.nextNode%28%29%29%7Bif(n.textContent.trim%28%29.length>0)n.textContent=window.getComputedStyle(n.parentNode).fontSize%3B%7D%7D%29%28%29
(function() {
var n,
walk = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, 0);
while (n = walk.nextNode()) {
if (n.textContent.trim().length > 0)
n.textContent = window.getComputedStyle(n.parentNode).fontSize;
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment