Windows 10 reached EOS (end of support) on October 14, 2025. For more information, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

On FireFox 22/23, javascript:window.open('', '_self', '');window.close(); is not working. Why is this? What should be solution on 22/23?

more options

On FireFox 22/23, javascript:window.open(, '_self', );window.close(); is not working. Why is this? What should be solution on 22/23?

This used to work on FF 17.

On FireFox 22/23, javascript:window.open('', '_self', '');window.close(); is not working. Why is this? What should be solution on 22/23? This used to work on FF 17.

All Replies (7)

more options

For me it seems to be working well. Could you please provide more details of your code?

more options

It's hard to display HTML accurately on this site, but I think you are trying to trick Firefox into thinking the current window was launched by a script and therefore can be closed by a script. A user reported on the mozillaZine Web Development forum that this stopped working in Firefox 21 (close window (Firefox version 21)), but I haven't tried to test it myself.

more options

hi, You are right. I just saw the link your posted, it seems to be close to mine. But here is my requirement. We have a Quit browser button in the UI, upon clicking it we expect the browser tab to be closed. The code that I am using is,

<input type="button", onlcick= "javascript:window.open(, '_self', );window.close();" />

This code was working in FF17, I guess. But its not working correctly. The above code works in IE and Chrome seemlessly.

Is there a suggesstion how to fix this? Highly appreciate the help.

more options

Actually due to security reason and user experience aspects you can now can't cause the browser to be closed[Completely], only popup windows can be closed or the one parent to a script.

more options

Thanks. So are you saying there is no way through Java script, I can close the browser TAB?

more options

Hi AbhilashSastry, I know some developers have a requirement for a button to close a window or tab originally opened by the user, but generally speaking, users know how to do that for themselves, so hopefully you can get the requirement waived.

more options

Exactly, only popups or parent owned child's can be closed as of now. :) And jscher is right, you don't need closing the tab people know how to do it so why spare couple of lines for it?