Window: afterprint event

The afterprint event is fired after the associated document has started printing or the print preview has been closed.

Bubbles No
Cancelable No
Interface Event
Event handler property onafterprint

Examples

Using addEventListener():

window.addEventListener('afterprint', (event) => {
  console.log('After print');
});

Using the onafterprint event handler property:

window.onafterprint = (event) => {
  console.log('After print');
};

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
afterprint_event
63
12
6
Yes
50
13
63
63
?
46
13
8.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Window/afterprint_event