我目前的破解驗證的修補程序。基本上,只是在window.print()之後,我綁定mousemove,單擊並按鍵來觸發我想要的操作(window.close();或window.location.href = somewhere;)。只要用戶確實沒有發生該動作什麼也沒有。但它工作得很好。 (當然,我可以住,直到錯誤被至少校正)
/*
// alternative to window.print() for dedicated print windows (had issue with <body onload=window.print()...
// not used anymore.
$('<a id="aprint" href="#" onclick="return window.print()" class="invisible"></a>').appendTo('body');
$('#aprint').trigger('click');
*/
$('body, select, input, textarea, button, submit, form').prop('disabled', true);
window.print();
setTimeout(function() {
$('body').bind('mousemove click keypress', function() {
window.location.href=home;
});
}, 200);
我也嘗試使用你'得到了處理window.open' – buley