window.close and self.close do not close the window in Chrome

后端 未结 16 1795
孤城傲影
孤城傲影 2020-11-21 05:48

The issue is that when I invoke window.close() or self.close() it doesn\'t close the window. Now there seems to be a belief that in Chrome you can\

16条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-21 06:22

    The below code worked for me -

    window.open('location', '_self', '');
    window.close();
    

    Tested on Chrome 43.0.2357.81

提交回复
热议问题