Use window.close() to close modal.