javascript 强制 Chrome/Firefox 进入全屏模式?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5085184/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Force Chrome/Firefox into Full Screen?
提问by Lance Pollard
I want to use chrome to display a full-screen html page for a presentation. You can set chrome to fullscreen mode, but it seems the only way to exit is moving the mouse to the top of the screen and clicking:
我想使用 chrome 为演示文稿显示全屏 html 页面。您可以将 chrome 设置为全屏模式,但似乎退出的唯一方法是将鼠标移动到屏幕顶部并单击:


I don't want to disable the ability to exit full-screen, I just want to make it so the only way to exit is via pressing the ESC key, not the mouse position. That way basically browser "admin" are the only ones who can get out of the presentation. Is that possible in Firefox or Chrome? Could I write an extension for this if it's not possible?
我不想禁用退出全屏的功能,我只是想让它退出的唯一方法是按 ESC 键,而不是按鼠标位置。这样基本上浏览器“管理员”是唯一可以退出演示文稿的人。这在 Firefox 或 Chrome 中可能吗?如果不可能,我可以为此编写扩展吗?
回答by drudge
Using my comment for an Answer:
使用我的评论作为答案:
Chrome implemented 'Kiosk Mode' in version 4.0.245.0. This is, essentially, a way to launch the browser in fullscreen mode with the Address Bar and Status Bar disabled. Some keyboard shortcuts (Fullscreen, for example) are also disabled.
Chrome 在 4.0.245.0 版本中实现了“信息亭模式”。这本质上是一种在禁用地址栏和状态栏的情况下以全屏模式启动浏览器的方法。某些键盘快捷键(例如,全屏)也被禁用。
On Windows: chrome.exe -kiosk http://yoursite.com/file.html
在 Windows 上: chrome.exe -kiosk http://yoursite.com/file.html
On everything else: chromium-browser --kiosk http://yoursite.com/file.html
关于其他一切: chromium-browser --kiosk http://yoursite.com/file.html
Note:Use your 'exit program' keyboard combo to kill it.
注意:使用“退出程序”键盘组合来杀死它。
回答by sid
For firefox, the add-on R-kiosk doea a similar job: https://addons.mozilla.org/en-US/firefox/addon/r-kiosk/
对于 firefox,附加 R-kiosk 做类似的工作:https://addons.mozilla.org/en-US/firefox/addon/r-kiosk/
I have used it before and it used to be pretty good for kiosk type applications. Haven't needed it in a while though.
我以前用过它,它曾经非常适合 kiosk 类型的应用程序。不过好久没用了。
To exit, you need to start firefox in safe mode and disable the add-on, which works very well for kiosk purposes.
要退出,您需要在安全模式下启动 firefox 并禁用附加组件,这对于 kiosk 用途非常有效。

