Issue with window.close and chrome

不羁岁月 提交于 2019-11-27 03:43:57

I know this question is old, but I ran into the same problem. This worked for me:

window.open('', '_self', ''); //bug fix
window.close();

if previously you open some other window by window.open()

this don't work:

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

but work:

window.open(...);
setTimeout(function(){
    window.open('', '_self', '');
    window.close();
}, 100);

Something like this should also work:

setTimeout(function() { window.close(); },50);

I think it's working in Chrome Kiosk ( Fullscreen ) mode. Tried successfully.

top.window.close() works for me. Tested on IE, FF, Chrome, Safari and Opera.

This worked for me

var win = window.open("about:blank", "_self"); win.close();

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!