Open johncrim opened 8 years ago
This is indeed an issue. The short version is that batarang fails to properly clean up the window name when leaving start.html
and as a consequence gets confused when loading land.htm
.
The reason is that the clean up is supposed to happen on a beforeunload
listener, but the event is not fired if you change the location before the DOM content has been loaded (which is what happens in start.htm
).
If you change beforeunload
to unload
in this line, everything seems to work, because (for whatever reason again) the unload
event if fired as expected.
A simple work-around (until this is fixed upstream) is to defer resetting the location, until after the DOM content has been loaded. E.g.:
// In 'start.htm':
setTimeout(function () { location.assign('land.htm'); }, 0);
The attached zip contains two simple pages, start.htm and land.htm. Start.htm redirects the browser to land.htm using javascript (
window.location.assign()
). Land.htm is a simple angular page that displays a message as to whether angular is successfully loaded or not.If you open Land.htm directly, it works as expected in any browser (you'll see the "Angular is loaded" text).
If you open start.htm in IE11, or in Chrome with Batarang disabled, you are redirected to land.htm, and you'll see the "Angular is loaded" text - expected behavior.
In Chrome with the AngularJS Batarang extension enabled, and with these pages served from an HTTP server, if you view the start.htm page, you are redirected to land.htm, and you see the "Angular is not loaded" message.
I wasted quite a while figuring out why angular was not loading after a redirect, and it turned out to be caused by this extension.
Batarang hangs Angular.zip