我有一个PWA,它有一个和一个。
我有一个只缓存某些请求的fetch事件的服务工作人员。这是在服务工作者中通过从缓存重写对代理的响应来完成的(为了清晰起见,TypeScript):
self.addEventListener('fetch', (event: FetchEvent) => {
// This MUST be synchronous until respondWith is called
const cache = isCachable(event.request);
if (!isCachable)
return;
我有manifest.json,我用<link rel="manifest" href="./manifest.json">添加到了HTML中。
我认为一切都很好,但我不明白为什么chrome工具不能检测到我的清单!
我的manifest.json
{
"name": "Arman News",
"short_name": "Ar News",
"description": "This is my first try to make PWA