javascript - 在javascript中刷新时保持全屏模式

标签 javascript refresh fullscreen

<script>
GoFullscreen();
location.reload(); // Browser automatically goes out of fullscreen on this
</script>

如果我在网页中使用这段代码,它会进入全屏、刷新,并且浏览器会因为刷新而自动退出全屏。我需要代码在不退出全屏模式的情况下进入全屏和刷新。

<script>
GoFullscreen();
RefreshPage(); // Refreshes the page without going out of fullscreen
</script>

类似的东西

如果您想知道我为什么要尝试这样刷新页面,这是解决我的其他问题的方法 here除非我在那里得到答案。如果有人知道如何在 Canvas 上重新加载数据处理源,那么我就不需要这个了。否则刷新整个页面是我所知道的重新加载数据处理源的唯一方法。

最佳答案

您可以将内容放入 100% 宽 x 100% 高的 iframe 中。然后让 iframe 自行刷新。包含 iframe 的页面可以设置为全屏,然后 iframe 刷新不会导致父页面失去全屏模式。

关于通过 JS 全屏的一些有用信息: How to make the window full screen with Javascript (stretching all over the screen)

关于javascript - 在javascript中刷新时保持全屏模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18707071/

相关文章:

javascript - 有没有一种简单的方法可以确定用户在哪个半球?

javascript - 如何从数组中删除子数组中具有相同元素的所有组合?

javascript - 调整元素大小但保持集中

asp.net-mvc - Mvc - 返回文件和刷新页面

javascript - 火狐 "Exited full-screen because windowed plugin was focused"

javascript - 如何使 document.getElementById ('id' ).value 返回一个数字而不是 Javascript 中的字符串

wpf - 如何让多人处理数据网格中的相同数据

javascript - 如何在 AngularJS 中刷新时保留服务中的数据?

jquery - Leaflet.js 不显示带有可折叠侧边菜单的全屏 map (简单侧边栏)

HTML5 视频 - 双击全屏