The WindowEventHandlers.onafterprint property sets and returns the afterprint
EventHandler
for the current window.
window.onafterprint = event handling code
The beforeprint
and afterprint
events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed. In general content authors should prefer the use of an @media print CSS at-rule, but it may be necessary to use these events in some cases.
The afterprint
event is raised after the user prints, or if they abort the print dialog.
Safari does not implement these events.
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'onafterprint' in that specification. | Living Standard |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 63 | Yes | 6 | Yes | 50 | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 63 | 63 | Yes | ? | 50 | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onafterprint