Created
September 5, 2018 20:05
-
-
Save abraham/16ee5219b82c507521b3ff583f3ea66d to your computer and use it in GitHub Desktop.
Enable CSS that is behind a `@media print` media query
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
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