Created
July 31, 2019 06:36
-
-
Save netsi1964/95f2cb7c529ddb169b263e7c617ddba9 to your computer and use it in GitHub Desktop.
Remove any styles from a website
This file contains hidden or 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
Array.from(document.styleSheets).forEach(sheet => sheet.disabled = true); | |
Array.from(document.querySelectorAll('*')).forEach(ele => { | |
ele.style.cssText = ''; | |
var before = getComputedStyle(ele, ':before'); | |
Object.keys(before).forEach(a => { | |
try {before[a] = ''} catch(e) {} | |
}); | |
var after = getComputedStyle(ele, ':after'); | |
Object.keys(after).forEach(a => { | |
try {after[a] = ''} catch(e) {} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment