我无法加载安装提示并要求用户添加到主屏幕我不明白将代码添加到哪个文件的位置。我正在运行一个 wordpress 网站。我有一个清单以及服务人员,但我无法将添加到主屏幕以在移动设备和/或桌面上弹出。请帮我
清单代码如下
{
"lang": "en",
"short_name": "canvasesbegone.com",
"name": "CanvasesBeGone",
"icons": [
{
"src": "assets/icons/launcher-icon-1x.png",
"type": "image/png",
"sizes": "16x16"
},
{
"src": "assets/icons/launcher-icon-2x.png",
"type": "image/png",
"sizes": "32x32"
},
{
"src": "assets/icons/launcher-icon-3x.png",
"type": "image/png",
"sizes": "48x48"
},
{
"src": "assets/icons/launcher-icon-4x.png",
"type": "image/png",
"sizes": "64x64"
},
{
"src": "assets/icons/launcher-icon-5x.png",
"type": "image/png",
"sizes": "96x96"
},
{
"src": "assets/icons/launcher-icon-6x.png",
"type": "image/png",
"sizes": "144x144"
},
{
"src": "assets/icons/launcher-icon-7x.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "assets/icons/launcher-icon-8x.png",
"type": "image/png",
"sizes": "300x300"
},
{
"src": "assets/icons/launcher-icon-9x.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "https://canvasesbegone.com/?utm_source=web_app_manifest",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#ffffff"
}
这是 service-worker.js 代码
self.addEventListener('fetch', function(event){
});