js关闭浏览器代码

    window_close() {
        window.opener.location.href = window.opener.location.href;
      if (
        navigator.userAgent.indexOf("Firefox") != -1 ||
        navigator.userAgent.indexOf("Chrome") != -1
      ) {
        window.location.href =
          location.href;
        window.close();
      } else {
        window.opener = null;
        window.open("", "_self");
        window.close();
      }
    }

 

你可能感兴趣的:(javascript)