当我尝试“添加到主屏幕”时,我在控制台中收到以下错误消息
Site cannot be installed: no matching service worker detected. You may need to reload the page, or check that the service worker for the current page also controls the start URL from the manifest
Run Code Online (Sandbox Code Playgroud)
注册服务工作者确实很顺利,似乎没问题: chrome application-Service Worker
它必须与范围有关,因为我在子域(/webconnect/)中运行我的网站:
该清单具有以下范围和 start_url 值:
“范围”:“/webconnect/”
“start_url”:“/webconnect/index.html”
我已经完成了故障排除部分,但这对我没有多大帮助:
Troubleshooting
If after testing you are getting the following error in your console:
No matching service worker detected. You may need to reload the page, or check that the service worker for …Run Code Online (Sandbox Code Playgroud)