remember that: you can fire window.close()
only on windows that have been opened with window.open()
See: Scripts may close only the windows that were opened by it
This method is only allowed to be called for windows that were opened by a script using the
window.open
method. If the window was not opened by a script, the following error appears in the JavaScript Console: Scripts may not close windows that were not opened by script.
that's the "nothing happens" you're facing. actually it's not absolutely nothing- a script message has been printed to the console.
hope that helps.