Browsers block scripts from closing tabs they didn't open. Press Cmd W (Mac) or Ctrl W (Windows) to close.