Hoppe Hoppe - 1 year ago 150
Javascript Question

Chrome window.print() window.close() results in 'print preview failed'. Solution?

I have a print page that opens in a new tab or window. The resulting page opens a print dialog. After the user makes a selection on the print dialog, the page then closes the tab/window.


This used to work great in the major browsers, but one of the latest versions of Chrome breaks this (i.e. 14.0.835.202).

I receive the following message from what I guess is the chrome print plugin: "Print preview failed".

Does anyone have a solution to close the Chrome tab/window after printing?

Answer Source

I don't think there are any standardised print events. IE has a couple, but I realise that doesn't help you for Chrome.

I think you might be left with only two options. A manual close button or some form of delay using setTimeout.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download