在android chrome浏览器中处于全屏模式时,不会反映元视口属性的值 [英] The values of meta viewport attribute are not reflected when in full screen mode in android chrome browser
问题描述
当我在使用全屏api的android中处于全屏模式时,元视口属性的值(如初始比例和用户可缩放)不会反映在浏览器中。如果我不是全屏模式,则会反映元视口的值。您可以访问 MDN进行检查:来自移动浏览器的全屏api示例
When I am in full screen mode in android using fullscreen api, the values of meta viewport attribute like initial-scale and user-scalable are not reflected in the browser. If I am not in full screen mode, the values of meta viewport are reflected. You can check it by accessing MDN:Fullscreen api example from a mobile browser
我没有找到任何消息来源说在Android中全屏禁用元视口。我犯了什么错误,或者没有人记录下来?
全屏时也禁用捏合和缩放
I don’t find any source saying meta viewport will be disabled in fullscreen in android. So am I making any mistake or no one has documented it? Also pinch and zoom is disabled when in fullscreen
在 https://github.com/whatwg/fullscreen/issues/111 但没有运气。
想要知道是否有其他方法可以解决它
Want to know if there are alternatives to solve it
推荐答案
我能够通过使用网络应用程序清单的替代方法全屏显示。它不会干扰元视口。
I was able to go fullscreen by an alternative method using the web app manifest. It does not interfere with the meta viewport.
以下是步骤
- 将其添加到头部:
<link rel="manifest" href="/manifest.json">
- 创建一个清单文件,如下所示: / li>
- Create a manifest file like the following:
{
"short_name": "App Name",
"name": "Full app name",
"icons": [
{
"src": "launcher-icon-4x.png",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "/index.html",
"display": "fullscreen",
"orientation": "landscape"
}
可以使用清单全屏启动的Google开发人员文档这里。
The Google developers documentation to launch in fullscreen using a manifest is available here.
引发全屏禁用元视图端口的问题这里。
The issue of fullscreen disabling the metaview port is raised here.
这篇关于在android chrome浏览器中处于全屏模式时,不会反映元视口属性的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!