如何强制我的Chrome浏览器接受.requestFullscreen()? [英] How to force my Chrome browser to accept .requestFullscreen()?

查看:321
本文介绍了如何强制我的Chrome浏览器接受.requestFullscreen()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为自己编写一个应用程序,在该应用程序中,我需要通过JavaScript自动进入全屏显示(今天,我模拟了F11的按下操作,该操作通常有效,但并非总是如此).

I am writing an application for myself in which I need to go fullscreen automatically via JavaScript (today I simulate the press of F11, which usually works, but not always).

我想使用 .requestFullscreen()(通过 screenfull.js ),但我得到

I would like to use .requestFullscreen() (via screenfull.js) but I get

无法在元素"上执行"requestFullscreen":API只能是由用户手势启动.

Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.

出于安全性/垃圾邮件/可用性的原因,这是可以理解的,并且在很多页面中都提到了.

This is understandable (for security / spam / usability reasons) and mentioned on numerous pages.

现在,由于这是我的应用程序在我的Chrome浏览器上运行,因此我希望能够在我的浏览器中允许此请求.这可能是Chrome的设置吗?

Now, since this is my application running on my Chrome browser, I would like to have the ability to allow this request in my browser. Is this a possible setting for Chrome?

推荐答案

您可以使用信息亭模式:

You can use kiosk mode:

在Windows上:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --chrome --fullscreen --kiosk http://10.20.30.40/page/

在Linux上

chrome  --chrome --fullscreen --kiosk http://10.20.30.40/page/

这篇关于如何强制我的Chrome浏览器接受.requestFullscreen()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆