2016-10-10 37 views
1

我想设置使用下面的清单JSON-文件的Web应用程序的默认方向:Web应用程序的清单:默认方向的设置被忽略

{ 
    "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" 
} 

使用铬合金的开发人员工具,我可以检查清单已经正确地加载和一切看起来罚款:方向设置为portrait(和显示fullscreen)。

但添加的Web应用程序在移动Chrome浏览器主屏幕,然后从那里打开它,我仍然可以在横向查看Web应用程序。

对此的任何帮助表示赞赏。谢谢。

回答

1

刚刚发现,如果display设置为standaloneorientation attribut只适用:

{ 
    … 
    "display": "standalone", 
    "orientation": "portrait", 
    … 
} 
+3

仍然不为我工作... –