Loading

js 关闭当前浏览器窗口

/**
 * 关闭浏览器窗口
 */
export const closeWindow = () => {
  var userAgent = navigator.userAgent
  if (userAgent.indexOf('Firefox') !== -1 || userAgent.indexOf('Chrome') !== -1) {
    window.location.replace('about:blank')
  } else {
    window.opener = null
    window.open('', '_self')
  }
  window.close()
}
posted @ 2021-08-03 10:07  Frank-Link  阅读(2818)  评论(0编辑  收藏  举报