Skip to content

Instantly share code, notes, and snippets.

@netsi1964
Created July 31, 2019 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netsi1964/95f2cb7c529ddb169b263e7c617ddba9 to your computer and use it in GitHub Desktop.
Save netsi1964/95f2cb7c529ddb169b263e7c617ddba9 to your computer and use it in GitHub Desktop.
Remove any styles from a website
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