JavaScript 全屏显示窗口

兼容IE,FireFox,Chrome等浏览器的全屏窗口显示(去除工具栏,状态栏等)
//login.html
function openMainPage(){
        window.opener = null;
        var screenWidth = screen.availWidth, screenHeight = screen.availHeight;
        var args = "toolbar=no, menubar=no, scrollbars=yes,resizable=yes,location=no, status=no";       

        //打开全屏的新窗口
        var win = window.open("main.htm","_blank",args);
        if(win){
            win.resizeTo(screenWidth,screenHeight);
            win.outerWidth = screenWidth;
            win.outerHeight = screenHeight;
            win.moveTo(0,0);
        }
        window.open('','_self');
        window.close();
    }  


//main.html
                 //页面加载时即关闭父窗口,此页面全屏显示
        if(window.opener){
            window.opener.opener = null;
            window.opener.open('','_self');
            window.opener.close();
            window.opener = null;
        }
原文地址:https://www.cnblogs.com/nj04w/p/1839530.html