[英]Chrome not showing “add to homescreen” in my PWA
我按照 Google 的第一個 PWA 教程創建了自己的項目https://my-pwa-77d8a.firebaseapp.com 。 一切看起來都很好:
manifest.json
文件<meta name="mobile-web-app-capable" content="yes">
標簽清單文件
{
"short_name": "PizzaApp",
"name": "My delicious PWA",
"icons": [
{
"src": "img/launcher-icon-2x.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "img/launcher-icon-3x.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "img/launcher-icon-4x.png",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "/index.html",
"display": "standalone",
"orientation": "portrait"
}
我可以從移動設備和桌面手動添加到主屏幕。 但 Chrome 從不顯示添加到主屏幕橫幅。 怎么了?
已解決
正如下面所指出的,我的服務工作者試圖緩存丟失的offline.html
文件。 我創建了文件,清除了手機的緩存,一切正常。
問題是您的offline.html
文件( https://my-pwa-77d8a.firebaseapp.com/offline.html )返回 404。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.