This bit doesn't work on b2g.  Scripts may not close windows that were not opened by the script.  :(