I am using the following code:
<script type="text/javascript">
var win;
win = window.open();
win.location.href = "somepage";
win.onload = function () {
alert(win.location.href);
};
</script>
somepage redirects to another page, which seems to be creating an unload event. The unload event never gets triggered, but if I change win.onload to win.onunload, it shows the href of the page of tab as soon as it loads, about:blank, and tries to direct to the href for somepage. I'm trying to get the href of the page it redirects to, before closing the page.