The page with the address currentUrl.ru open. A tab from the code is opened.
For example:
window.open('currentUrl.ru', '_blank'); When the print in the second tab on the first blocking code execution. But if you open the second tab manually (press the plus sign and enter the address), then the tabs of each other do not block.
Is it possible to break the connection between tabs from code?
Copy-paste function that blocks all page buttons until I close the print window:
function printThisLayout(layout, styles) { if (!styles) styles = ''; let popupWin = window.open('', '_blank', 'width=800,height=600'); let onload = 'window.opener = null;' + 'alert(window.opener);' + 'window.document.close(); /*necessary for IE >= 10*/' + 'window.focus(); /*necessary for IE >= 10*/' + 'window.print();' + 'window.close();'; popupWin.document.write( '<html>' + '<head>' + '<style>' + styles + '</style>' + '</head>' + '<body>' + layout + '</body>' + '<script>' + onload + '</script>' + '</html>'); } In the window that opens, an alert appears with the inscription null, after the alert is closed, the print dialog opens, and the parent tab still hangs.