Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. (function() {
  2. var beforePrint = function() {
  3. // Change to the black theme
  4. };
  5. var afterPrint = function() {
  6. // Change back to the original theme
  7. };
  8.  
  9. if (window.matchMedia) {
  10. var mediaQueryList = window.matchMedia('print');
  11. mediaQueryList.addListener(function(mql) {
  12. if (mql.matches) {
  13. beforePrint();
  14. } else {
  15. afterPrint();
  16. }
  17. });
  18. }
  19.  
  20. window.onbeforeprint = beforePrint;
  21. window.onafterprint = afterPrint;
  22. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement