Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Enable CSS that is behind a `@media print` media query
Object.keys(document.styleSheets).forEach(function(styleSheetKey) {
var rules = document.styleSheets[styleSheetKey].rules || {};
Object.keys(rules).forEach(function(ruleKey) {
var media = rules[ruleKey].media;
if (media) {
media.mediaText = media.mediaText.replace('print', 'screen');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment