需要在页面加载时全屏显示托管的html页面

Need to display hosted html page in full screen on page load

本文关键字:显示 页面 html 加载      更新时间:2023-09-26

我正在开发一个GWT web应用程序,为了满足特定的需求,我需要在加载时全屏显示我唯一托管的html页面。这是我们在任何网页上按F11的帮助下完成的。在我的GWT应用程序中,我需要完全相同的功能。

我尝试了一下Javascript,但没有成功。

<script language="JavaScript1.2">
    top.window.moveTo(0,0);
    if (document.all) {
        top.window.resizeTo(screen.availWidth,screen.availHeight);
    }
    else if (document.layers||document.getElementById) 
    {
        if   (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
    top.window.outerHeight = screen.availHeight;
    top.window.outerWidth = screen.availWidth;
        }
    }
</script>

这可能吗?

您不能强迫用户如何显示文档。尽管如此,还是有一个全屏api的草案,另请参阅https://developer.mozilla.org/en/DOM/Using_full-screen_mode

我认为您需要使用加载的页面来启动一个包含完整页面html的新浏览器窗口。第一个页面只是用这样的脚本启动完整页面

<script>
<!--
window.open("fullpage.html","fs","fullscreen=yes")
//-->
</script>