js关闭手机浏览器页面
作者:互联网
if (navigator.userAgent.indexOf("MSIE") > 0) {
if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
window.opener = null;
window.close();
}
else {
window.open('', '_top');
window.top.close();
}
}
else if (navigator.userAgent.indexOf("Firefox") > 0) {
window.location.href = 'about:blank '; //火狐默认状态非window.open的页面window.close是无效的
//window.history.go(-2);
}
else {
window.opener = null;
window.open('', '_self', '');
window.close();
}
标签:浏览器,indexOf,js,window,userAgent,close,navigator,open,页面 来源: https://blog.csdn.net/qq_44916384/article/details/116131929