Hi, I have below two test html pages as below(could not find a way to insert a attachment, so paste the content below). The reproduce step is as below: (My environment is Win8.1 with IE11)
1. Open print_test.html page in IE, here we call page1.
2. Click "File -> New Session" menu from IE menu bar, which will open another new IE window which display another " print_test.html" page, here we call page 2.
3. Click "Print" hyper-link in page1, and a popup window which display "print_test_open.html" page, counting begins from 1, here we call it page 3.
4. Click "Print" hyper-link in page2, and another popup window which display "print_test_open.html" page, counting begins from 1, here we call it page 4.
However, the behavior above is totally different on my Win7 (64 bit) with IE 10, which is in step 4, when I click "Print" hyper-link in page2, instead of open a new popup window, the window for page 3 will be reused and counting will restart from 1.
I googled and know from MDN for window.open() and get below information to indicate that in my test pages, I use the same window name, so that the existed window with the same name will be reused is as expected, but however, why IE behave differently in Win8.1 with IE 11? Why the existed window could not be reused anymore?
If a window with the name strWindowName already exists, then, instead of opening a new window, strUrl is loaded into the existing window. In this case the return value of the method is the existing window.
The behavior in Win8.1 + IE 11 is similar with what Google Chrome does, and Chrome's explanation is that two separated window using separated processes which do no share information, so that even using the same window name. twp separated windows will popup.. So I am confused here, IE 10 and IE 11 are both using multi-process mechanism right? I saw from the Windows Task Manager, when using "File -> New Session" to open another print_test.html page in step 2. both IE 10 and IE 11 are opening 4 iexplore.exe processes, two of them are 64 bit, and two of them are 32 bit. I can't see any configuration difference between these two envs, but why the behavior is so different?
Could anyone give some help and clarify here? Great thanks in advance.
Oh, btw, another colleague can reproduce the issue (open separated windows even using the same window name) in his Win7 64 bit with IE 10 env, but could not reproduce in his Win 32 bit with IE 10 env... Hope this information could also do help.
======================== Test pages ===============================
(1) print_test.html
<!DOCTYPE html>
<html>
<head>
<title>Print test</title>
<head>
<body>
<h1>Print test</h1>
<p><a href="javascript:void(0)" onclick='window.open("print_test_open.html", "test");'>Print</a></p>
<p><a href="javascript:void(0)" onclick='window.open("print_test_open.html", "test"); myWindow.location.reload(true);'>Print (force refresh)</a></p>
</body>
</html>
(2) print_test_open.html
<!DOCTYPE html>
<html>
<head>
<title>Open</title>
<head>
<body>
<h1>
<div id="count">Test</div>
</h1>
<p>Test</p>
<script type="text/javascript">
var e = document.getElementById("count");
sessionStorage['count'] = 0;
function timedCount() {
i = sessionStorage['count'];
i++;
sessionStorage['count'] = i;
e.innerHTML = "Count: " + i;
setTimeout(function(){timedCount()},100);
};
timedCount();
</script>
</body>
</html>