Last active
January 9, 2017 11:31
-
-
Save fitnr/8ef668d286d7113afaf8db0468aac2d7 to your computer and use it in GitHub Desktop.
Replaces all text on a page with the font size. Useful for debugging the page or just replacing wretched content with something less awful.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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