window.close() doesn't work - scripts may close only the windows that were opened by it code example
Example: Scripts may close only the windows that were opened by them
open window with target="_blank"
and the perform window.close();
open window with target="_blank"
and the perform window.close();