window.close() does not work in Firefox 2.0 upwards

I have been trying to close a window using javascript and the window.close to no avail. I have found a few suggestions like:
. Copy/paste the following code to the head of your page…

<script language="javascript" type="text/javascript">

function closeWindow() {'','_parent','');




2. Set your link like this:

<a href="javascript:closeWindow();">Close Window</a>

but that did not have any effect. So I am guessing it was for FF < 3.0 probably <2.0. I have also tried using window.focus() and self.close(). Also I am not trying to kill the window from a popup so it should not be a problem of javascript origin. Another 'solution' that failed was:
So does anybody know if there is a way of doing it or is it impossible?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you trying to do this from the main window? i.e. not trying to close a popup and / or not trying to close the main window from a popup?
schwagoAuthor Commented:
Yes, I am trying to do this from a window I opened by hand and not with javascript. I get the error: a page not opened with javascript can not be closed with a script. I was wondering if it was possible to circunvent that.
As far as I am aware the only windows you are allowed to close using javascript, are windows you have opened using javascript e.g. etc

Otherwise people could close your window at will, which could be incredibly annoying.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

please set your firefox browser:

1.input "about:config " to your firefox address bar and enter;

2.make sure your "dom.allow_scripts_to_close_windows" is true

function closeMe()
<input type="button" name="Close" onclick="closeMe()" />

Open in new window

any update @schwago:

As far as I tested, for most browsers (includin ff2 & ff3, without need for changing browser conf.) this should work:
<input type="button" name="Close" onclick="javascript: window.opener = window.self; window.close();" />

Open in new window

Michel PlungjanIT ExpertCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.