Skip to content

Instantly share code, notes, and snippets.

@a-am
Forked from gauntface/toggle-remote-styles.js
Created October 8, 2015 17:53
Show Gist options
  • Save a-am/a895de3887696b02d625 to your computer and use it in GitHub Desktop.
Save a-am/a895de3887696b02d625 to your computer and use it in GitHub Desktop.
A book marklet to toggle styles.
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