你好我得到這個錯誤:安裝的網絡應用在Chrome瀏覽器的Web應用程序清單爲Android不工作
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
這是我的manifest.json:
{
"name": "SIMIC project",
"short_name": "simic",
"icons": [{
"src": "images/simic-bn.png",
"type": "image/png",
"sizes": "32x32"
},
{
"src": "images/simic-bn.png",
"type": "image/png",
"sizes": "144x144"
}],
"start_url": "/wta/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#1e88e5"
}
這是我的網址: 「MYDOMAIN:8889/WTA /」,這是我的代碼結構:
-mydomain
--- WTA
------ CSS/
------字體/
------圖像/
------ JS/
------ index.html的
------ manifest.json的
我在想什麼? THX
thaks爲您的答案!我明白你說的是什麼,但是我有什麼要寫在我的服務人員身上?你寫的代碼只是一個指向服務人員的js文件,不是嗎? 「service-worker.js」包含什麼? –
我跟着這個鏈接:https://codelabs.developers.google.com/codelabs/add-to-home-screen/#5 ....我添加了這個:「self.addEventListener('fetch',function(event ){ \t \t });「在我的服務工作文件中。它工作正常! –