Last active
May 11, 2021 08:10
-
-
Save Nixinova/b038890ce819fd1383629a442d8442f8 to your computer and use it in GitHub Desktop.
Strip all CSS from HTML source
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
// Place in devtools | |
function decss(html) { | |
return html | |
.replace(/<link\s+rel=('|"|\s*)stylesheet.*?>/g, '') | |
.replace(/style=".+?"/g, '') | |
} | |
basehtml = document.getElementsByTagName('html')[0] | |
basehtml.innerHTML = decss(basehtml.innerHTML) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment