5 Star 3 Fork 0

Gitee 极速下载/Frontend-Checklist

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/thedaviddias/Front-End-Checklist
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
service-worker.js 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
// importScripts('/cache-polyfill.js');
'use strict';
var version = 'v1::';
self.addEventListener("install", function(event) {
// console.log('WORKER: install event in progress.');
event.waitUntil(
/* The caches built-in is a promise-based API that helps you cache responses,
as well as finding and deleting them.
*/
caches
/* You can open a cache by name, and this method returns a promise. We use
a versioned cache name here so that we can remove old cache entries in
one fell swoop later, when phasing out an older service worker.
*/
.open(version + 'fundamentals')
.then(function(cache) {
/* After the cache is opened, we can fill it with the offline fundamentals.
The method below will add all resources we've indicated to the cache,
after making HTTP requests for each of them.
*/
return cache.addAll([
'/',
'/index.html',
'/styles/main.min.css',
'/scripts/app.bundle.js'
]);
})
.then(function() {
// console.log('WORKER: install completed');
})
);
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/Frontend-Checklist.git
git@gitee.com:mirrors/Frontend-Checklist.git
mirrors
Frontend-Checklist
Frontend-Checklist
gh-pages

搜索帮助