简体   繁体   English

无法为我的 android 主屏幕 web 应用程序更新 manifest.json

[英]Can't update manifest.json for my android homescreen webapp

I can't seem to get the manifest.json (associated with my webapp on my android phone) updated.我似乎无法更新 manifest.json(与我的 android 手机上的 webapp 相关联)。

I created a web page我创建了一个网页
Created the needed manifest.json file as:创建所需的 manifest.json 文件为:

{
    "lang": "en",
    "display": "fullscreen",
}

Included the link in the html of the web page在网页的 html 中包含链接

<link rel="manifest" href="http://yoursite.com/manifest.json">

Brought up the web page on my Samsung android phone in the browser (Samsung Internet 2.1) and clicked "Add shortcut to home screen"在浏览器(Samsung Internet 2.1)中打开我的三星 android 手机上的网页,然后单击“添加到主屏幕的快捷方式”
All looked good.一切看起来都很好。 The shortcut was on the Homescreen with the icon and took me to the webpage in fullscreen mode.快捷方式位于带有图标的主屏幕上,并以全屏模式将我带到网页。

Now I am trying to change some things in the manifest.json.现在我正在尝试更改 manifest.json 中的一些内容。 I wanted to add start_url and add some URL parameters.我想添加 start_url 并添加一些 URL 参数。 So I deleted the icon on the home screen, changed the code in the manifest.json on the webserver.所以我删除了主屏幕上的图标,更改了网络服务器上 manifest.json 中的代码。 Loaded the webapge in the browser and added the shortcut to the homescreen.在浏览器中加载网页并将快捷方式添加到主屏幕。 But the url parameters were not passed to the webpage.但是url参数没有传递给网页。

I did the same steps again, but with a manifest.json with a different url.我再次执行了相同的步骤,但使用了具有不同 url 的 manifest.json。 no dice.没有骰子。
Tried changing "fullscreen" to "browser".尝试将“全屏”更改为“浏览器”。 Then delete Icon, add to homescreen, try again.然后删除图标,添加到主屏幕,再试一次。 Nope - still in full screen mode.不 - 仍处于全屏模式。 I also tried a different file name for manifest.json.我还为 manifest.json 尝试了不同的文件名。 As well as a different <title> on the webpage.以及网页上的不同<title>

Try as I might, I can't seem to get a different manifest.json to be saved.尽我所能,我似乎无法保存不同的 manifest.json。

What am I missing/doing wrong????我错过了什么/做错了什么???
I assume manifest.json is saved on the phone.我假设 manifest.json 保存在手机上。 Can/should I manually delete it (Although I can't find it).我可以/应该手动删除它吗(虽然我找不到它)。

Ok I think I figured it out.好吧,我想我想通了。 My bad in thinking the manifest.json was applicable to more than just Chrome.我认为 manifest.json 不仅仅适用于 Chrome。 It looks like the manifest.json has nothing to do with my webapp behaving as it does.看起来 manifest.json 与我的 web 应用程序的行为无关。 But rather this meta tag:而是这个元标记:

<meta name="apple-mobile-web-app-capable" content="yes" />

This tag is what makes the shortcut on the homescreen open the browser in fullscreen mode.此标签使主屏幕上的快捷方式以全屏模式打开浏览器。 I believe this was originally made for safari(?) but adopted by the samsung browser i am using.我相信这最初是为 safari(?) 制作的,但被我正在使用的三星浏览器采用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM