This is probably the browser security that avoids been able to close the window programmatically. If you can make another page that you control launch the game then you should be able to close it from the parent. Sending a signal from the game to it.
What do you mean?
It used to work fine on every project in the past. It works fine with every new projects I made. Only in the project I'm currently working on for some reasons this is not working. There is nothing different between this project or any other projects.
It's just a simple action. on sprite touched -> close window
EDIT: hmm and now for some other strange reasons it starts to work properly... without me doing anything