javascript - Service Worker 错误“未捕获(承诺)DOMException:超出配额。”
问题描述
我正在尝试构建一个 PWA 应用程序。该应用程序在其他设备和机器浏览器上运行,但在我的 Chrome 浏览器中,我的浏览器出现以下错误。
Uncaught (in promise) DOMException: Quota exceeded. service-worker.js:1
服务工作者文件:
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo(dot)gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Workbox build configuration
* and re-run your build process.
* See https://goo(dot)gl/2aRDsh
*/
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"/mywebpage/precache-manifest.js"
);
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});
workbox.core.clientsClaim();
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo(dot)gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/mywebpage/index.html"), {
blacklist: [/^\/_/,/\/[^\/?]+\.[^\/]+$/],
});
解决方案
推荐阅读
- css - 垂直对齐 ag-grid 单元格内的文本
- php - 三元运算符和 PHP 包括
- linux - 如何通过 grub2 以与发行版无关的方式从作为根设备加载的 cpio 存档中获取 initrd?
- javascript - 如何确定是否已声明 Javascript 类?
- maven - Maven:如何在分叉的 JVM 中执行依赖项?
- angular - 从 HTTP 检索的建模数据以生成动态 Material 2 表
- javascript - 使用 Control.Draw 工具在被拖动后检测标记的原始位置和修改位置
- c - 为什么 free() 放置随机数据块而不是删除节点?
- mysql - 如何在 MySQL 中正确使用 INNER JOIN
- c - 最常见的 K 长度序列