Please see my comment to the question. For some more background, see also my recent answer:
How I Can Close My Current browser Window Using Jquery or Javascript[
^].
I do understand that your situation can be different, so we could discuss it. But, generally,
window.close()
cannot close a current tab; you just cannot close it with JavaScript, and, I think, for some good reasons.
—SA