Skip to content

Instantly share code, notes, and snippets.

@ckknight
Forked from NeilHanlon/inhouse.js
Last active December 18, 2015 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ckknight/5855529 to your computer and use it in GitHub Desktop.
Save ckknight/5855529 to your computer and use it in GitHub Desktop.
(function(){
var oldPrint = window.print;
var slice = Array.prototype.slice;
window.print = function () {
if (typeof window.onbeforeprint === "function") {
window.onbeforeprint.apply(this, slice.call(arguments));
}
oldPrint.apply(this, slice.call(arguments));
if (typeof window.onafterprint === "function") {
window.onafterprint.apply(this, slice.call(arguments));
}
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment