The values of meta viewport attribute are not reflected when in full screen mode in android chrome browser

南楼画角 提交于 2019-11-28 10:37:54
Agnel Vishal

I was able to go fullscreen by an alternative method using the web app manifest. It does not interfere with the meta viewport.

Here are the steps

  1. Add this to the head section:
<link rel="manifest" href="/manifest.json">
  1. 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"
  }

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.

Unfortunately the answer is no, you cannot control how the meta viewport attribute is handled. "Full webpage and disabled zoom viewport meta tag for all mobile browsers" covers many Android and iOS versions in fullscreen. However, you can use a series of browser/ version detection to work around known bugs. It's not elegant, but given Android's fragmentation it might be necessary.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!