我一直在按照https://www.pwabuilder.com上的说明使我的网站可离线使用。在控制台日志中,我收到消息,指出 PWA 已安装,并已离线缓存,但我在标题中收到错误消息。
我去过许多 stackoverflow 线程和其他网站,但我正在尝试的任何东西都不起作用。这不是我的强项,我是一名 UX/UI 设计师,可以编写简单的静态页面,但目前这略高于我的技能水平。
我真的很难弄清楚如何解决这个问题,因为(对我来说)这个错误很模糊。我假设它是我错过的一些简单的东西。网站 url 是https://ovoc.netlify.com/但我也会链接下面的清单和服务工作者
清单文件
{
"dir": "ltr",
"lang": "en",
"name": "Our voice our community | Get involved in de…",
"scope": "/",
"display": "fullscreen",
"start_url": "https://ovoc.netlify.com/",
"short_name": "OVOC",
"theme_color": "transparent",
"description": "Our voice our community is a project run by BGC Wales to empower young people to engage in community decision making",
"orientation": "any",
"background_color": "transparent",
"related_applications": [],
"prefer_related_applications": false,
"icons": [{
"src": "assets/icons/logo.png",
"sizes": "192x192",
"type": "image/png"
}]
}
这是服务人员
// This is the "Offline copy of pages" service worker
const CACHE = "pwabuilder-offline";
// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "index.html";
const offlineFallbackPage = "index.html";
// Install stage sets up the index page (home page) in the cache and opens a new cache
self.addEventListener("install", function (event) {
console.log("[PWA Builder] Install Event processing");
event.waitUntil(
caches.open(CACHE).then(function (cache) {
console.log("[PWA Builder] Cached offline page during install");
if (offlineFallbackPage === "index.html") {
return cache.add(new Response("TODO: Update the value of the offlineFallbackPage constant in the serviceworker."));
}
return cache.add(offlineFallbackPage);
})
);
});
我真的很挣扎,我的客户是一个慈善机构,所以我真的很想为他们做这项工作,任何帮助将不胜感激!
慕尼黑的夜晚无繁华
HUH函数
相关分类