我正在尝试在nwjs中设置服务工作者,以缓存CDN中的图标。
ngsw-config.json
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "icons",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"urls": [
"https://img.icons8.com/**"
]
}
}
]
}
但是我得到了错误:
Uncaught (in promise) TypeError: Request scheme 'chrome-extension' is unsupported
at CacheTable.write (ngsw-worker.js:138)
at Driver.<anonymous> (ngsw-worker.js:2220)
at Generator.next (<anonymous>)
at fulfilled (ngsw-worker.js:1787)
服务人员似乎已注册,但缓存图标不起作用。是否有人已经在nwjs中成功使用angular service worker