Skip to content

Instantly share code, notes, and snippets.

@ilhantekir
Forked from gauntface/toggle-remote-styles.js
Created July 28, 2018 11:56
Show Gist options
  • Save ilhantekir/95a082c4c1701306a0d6ebd4e3b851ed to your computer and use it in GitHub Desktop.
Save ilhantekir/95a082c4c1701306a0d6ebd4e3b851ed 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