Window: beforeprint event

The beforeprint event is fired when the associated document is about to be printed or previewed for printing.

Bubbles No
Cancelable No
Interface Event
Event handler property onbeforeprint


Using addEventListener():

window.addEventListener('beforeprint', (event) => {
  console.log('Before print');

Using the onbeforeprint event handler property:

window.onbeforeprint = (event) => {
  console.log('Before print');


Specification Status
HTML Living Standard Living Standard

Browser compatibility

No compatibility data found. Please contribute data for "api.Window.beforeprint_event" (depth: 1) to the MDN compatibility data repository.

See also

Document Tags and Contributors

Last updated by: mdnwebdocs-bot,