Fixed window.close() not working

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