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();
      }
    }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章