Who closed the browser tab?-Collection of common programming errors
I feel retarded.
So, days of investigating this issue I discovered that my code was invoking a function in case of a network error and this function was invoking close()
. Instead of resolving to my class’ close()
method, it resolved to window.close()
instead. Guess what happened next? 🙂 The tab closed.
What made this problem particularly difficult were two Chrome-specific bugs:
In short: window.close()
works when it shouldn’t, and when it fails it does so silently.
Anyway, I consider this matter closed. I hope this helps others avoid making the same mistake in the future.