In Microsoft Edge, window.close()
is not working in child windows after closing a print dialog.
Steps to reproduce:
After closing the print dialog, the close button of the child window is not closing it.
<script type="text/javascript">
function openChild(){
window.open("childWindow.html", "", "width=600, height=400");
}
</script>
</head>
<body>
<input type="button" value="Open Child Window" onclick="openChild()" />
</body>
<script type="text/javascript">
function closeWindow(){
window.close();
}
function printPage() {
window.print();
}
</script>
</head>
<body>
<input type="button" value="Print" onclick="printPage()" />
<input type="button" value="Close Window" onclick="closeWindow()" style="float: right" />
</body>
Im not sure if this is related, but I saw an article where window.close() will not work in edge after a print dialog has been canceled. Maybe it is the same bug? Microsoft support article
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With