Skip to content

Instantly share code, notes, and snippets.

@MarioSo
Forked from gauntface/toggle-remote-styles.js
Created October 23, 2015 08:09
Show Gist options
  • Select an option

  • Save MarioSo/3af2fcb59905012c91cc to your computer and use it in GitHub Desktop.

Select an option

Save MarioSo/3af2fcb59905012c91cc 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