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

前端 未结 6 1946
无人及你
无人及你 2020-11-30 10:19

I want to close window on logout. I have used

  • window.close(),
  • self.close(),
  • var win = window.open(\"\",\"_s
6条回答
  •  天命终不由人
    2020-11-30 10:52

    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.

提交回复
热议问题