Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web App manifest: Setting of the default orientation is ignored

I am trying to set the default orientation of a Web App using the following manifest JSON-file:

{
  "manifest_version": 2,
  "version": "0.9",
  "short_name": "My Web App",
  "name": "My Web App in Portrait Mode",
  "icons": [
    {
      "src": "/homescreen-icon.png",
      "sizes": "196x196",
      "type": "image/png"
    }
  ],
  "start_url": "/index.php",
  "display": "fullscreen",
  "orientation": "portrait",
  "theme_color": "#5a8238",
  "background_color": "#1a2a08"
}

Using Chromes developer tools I can check if the manifest has loaded correctly and all looks fine: Orientation is set to portrait (and Display to fullscreen).

But adding the web app to the homescreen on mobile Chrome and then open it from there, I can still view the Web App in landscape.

Any help on this is appreciated. Thanks.

like image 574
Karsten Avatar asked Oct 19 '22 00:10

Karsten


1 Answers

Just found out that the orientation attribut only works if display set to standalone:

{
  …
  "display": "standalone",
  "orientation": "portrait",
  …
}
like image 55
Karsten Avatar answered Oct 21 '22 06:10

Karsten