Fixed window.close() not working

When clicking on the close button, nothing happens.
Fixed with this "hack".
Source: http://stackoverflow.com/questions/19761241/window-close-and-self-close-do-not-close-the-window-in-chrome