js关闭窗口兼容firefox、chrome、ie

function windowclose() {
    var browserName = navigator.appName;
    if (browserName=="Netscape") {
        window.open('', '_self', '');
        window.close();
    }
    else {
        if (browserName == "Microsoft Internet Explorer"){
            window.opener = "whocares";
            window.opener = null;
            window.open('', '_top'); 
            window.close();
        }
    } 
}

 

你可能感兴趣的:(firefox)