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.
Just found out that the orientation
attribut only works if display
set to standalone
:
{
…
"display": "standalone",
"orientation": "portrait",
…
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With