I’ve application to open popup window to print page.
function printHTML(urlPath) {
var printPopUp = window.open(urlPath,null,"height=600,width=777,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes");
printPopUp.print();
}
This script is working fine in IE, but in firefox/chrome. print() function is overlapping window.open, as a result the print dialog is showing first while screen is still loading. I need to close print dialog in order to render the page properly then print manually.
Please advise.
As indicated in your comment, the urls to print are on the same domain. You cannot access the content of the other windows so you will have to set up some code on the popped up window that will call the opener to tell it it has opened.
popup.html
main.html