javascript - 强制 Chrome/Firefox 进入全屏?

标签 javascript firefox google-chrome

我想使用 chrome 显示全屏 html 页面以进行演示。您可以将 chrome 设置为全屏模式,但似乎退出的唯一方法是将鼠标移动到屏幕顶部并单击:

enter image description here

我不想禁用退出全屏的能力,我只想让它退出,所以退出的唯一方法是按 ESC 键,而不是鼠标位置。这样基本上浏览器“管理员”是唯一可以离开演示文稿的人。这在 Firefox 或 Chrome 中可能吗?如果不可能的话,我可以为此写一个扩展吗?

最佳答案

使用我的评论作为答案:

Chrome 在版本 4.0.245.0 中实现了“Kiosk 模式”。本质上,这是一种在禁用地址栏和状态栏的情况下以全屏模式启动浏览器的方法。一些键盘快捷键(例如全屏)也被禁用。

在 Windows 上:chrome.exe -kiosk http://yoursite.com/file.html

关于其他一切:chromium-browser --kiosk http://yoursite.com/file.html

注意:使用“退出程序”键盘组合键将其终止。

关于javascript - 强制 Chrome/Firefox 进入全屏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5085184/

相关文章:

html - 如何在 Firefox 中获取我自己的光标坐标?

python - 无法使用 Python Selenium 单击元素

google-chrome - karma :从WSL使用Windows的Chrome

javascript - 在 Firefox 中生成 jsPDF 时存在兼容性问题的 pdf 吗?

javascript - javascript内置split函数的大O

javascript - Firefox 中 Google 的 downloadDataURI

javascript - Chrome/谷歌分析-ga.js :1 Uncaught SyntaxError: Unexpected token ILLEGAL

javascript - 检测移动浏览器 : How to rewrite the following into an if AND else statement?

javascript - 为什么我的 JavaScript if 语句总是 true?

css - 为什么 Firefox 18 使用 -moz-transform 渲染元素的方式与 Firefox 17 不同?