Any body knows how to close a firefox new tab window using javascript by clicking a hyper link?

I used the following code

<a href="" onclick="window.close()">Close this window</a>
<A href="javascript: self.close ()">Close this Window</A>

It works for new windows .But it will not works for firefox new tabs..

You are not allowed to close a tab in firefox. It is their policy to not allow it because user should have control over a page at all time. However, a pop up which is opened by javascript may be closed by its parent window using javascript...