Created
January 17, 2023 07:55
-
-
Save szepeviktor/69d88d8fdcbe7ed0e21432c160dd7493 to your computer and use it in GitHub Desktop.
Disable CSS: remove all styles from a web page
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
document.querySelectorAll("link[rel=stylesheet], style").forEach(element => element.remove()); | |
document.querySelectorAll("[style]").forEach(element => element.removeAttribute("style")); |
Replace images with alt
attributes and remove script elements, tag headings.
document.querySelectorAll("script").forEach(element => element.remove());
document.querySelectorAll("img").forEach(function (element) {element.loading="eager"; element.src=""; element.srcset=""; element.alt="[🎨"+element.alt+"]";});
document.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(function (element) {element.innerHTML=element.tagName+">"+element.innerHTML;});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adding Normalize.css