Last active
March 12, 2020 12:56
-
-
Save gauntface/0c9a02de2ea261aef0ec to your computer and use it in GitHub Desktop.
A book marklet to toggle styles.
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
javascript:(function(){var styles = document.querySelectorAll('link[rel=\'stylesheet\']'); for (var s = 0; s < styles.length; s++) {styles[s].mediax = styles[s].media;if (styles[s].media === 'only x') { styles[s].media = styles[s].mediax; } else if (styles[s].media !== 'print') {styles[s].media = 'only x';}}})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are you ok with me making a Chrome extension from this?
Edit: Never mind, I rewrote this part. The chrome extension is live now, though :) (shameless plug) https://chrome.google.com/webstore/detail/view-crit-css/adbfbeilhdoemcglklgecpkoagnfndhd