I can think of two possible ways worth trying ...
First, you can approach this by letting the child window talk to the parent window, not the parent. As long as the parent window loses the link to the child, when the page goes over, the child can still return to the new page (while it is still in the same domain) through window.opener. The child could use the set interval to access the open window and set the status to "still open". You would have to encode it in such a way as to be able to process not the presence of a document during a transient load, but it would work. The code will be approximately the same as shown below, but you can clarify this by handling the load and unloading the parent's events as a child and only starting the timer between transitions.
Parent window (all pages)
var childStatus = "unknown";
Children's window
var timerHandler; funciton ChildCallBack() { try { window.opener.childStatus = "open"; } catch(e) { } } timerHandler = window.setInterval(ChildCallBack, 100); function window_onclose() { try { window.clearInterval(timerHandler); window.opener.childStatus = "closed"; } catch(e) { } } window.onclose = window_onclose;
Secondly, and ideally, as a last resort, another rather terrible alternative is to use iframe. Put your transition page in an iframe so that the actual main page does not change and therefore can support the link to the child. The iframe can be large enough to appear as a full page. This is an unpleasant hacked solution, but it should also work.
source share