"Web apps should behave like native apps!"

OK…

window.onerror = window.close();

@codepo8
This closes the window much sooner than you were expecting.