window.close() doesn't work on Firefox, any work around?

后端 未结 4 844
时光说笑
时光说笑 2020-12-03 19:53

I am trying to close a window using window.close() but this works on IE only but not on Firefox. Has anyone encountered this one and any work around?

Thanks...

4条回答
  •  一向
    一向 (楼主)
    2020-12-03 20:29

    Did your script open the window? Firefox 2 and later do not allow scripts to close windows that they did not open.

    You could try this trick, but I have no idea whether it will work. I live on the side of the population that believes users should be in control of their browser windows, not applications (despite the fact you may have a good reason for this).

提交回复
热议问题