print window 关闭后执行命令

Execute Commands after print window is closed

我正在使用以下代码打印网页:

window.print();

我想在打印对话框关闭后执行一些命令。我怎样才能检测到它?

window.onload = PrintMe;

function PrintMe() {
    window.print();

    alert("Closed Printing");


}