window.close(), self.close() not working on mozilla firefox

Solution 1:

I tried to review all topics about window.close() and have found that: IE/Chrome/Safari(?) accept closure if we open something on _self, so generally

top.open('','_self',''); top.close();

does the work. FF (r 19 when writing this) is more strict about this and somehow forbids any probe like above. The good answer was found in related thread, that user must manually allow FF to have solution above working

about.config -> dom.allow_scripts_to_close_windows = true;

I was quite desperated, as Customer requested window closure on completed operation.

Big bravo to FF dev team. This is exactly how it should work; pity only is that is hard to find it.

Pawel.

Solution 2:

I have found that Firefox can only use window.close() when script has been called to open that window in the first place.

Read here for more info.

So if you didn't use a script to open that window, it can't be done.