Commit 1dc4cf28 by libai

测试

parent 0d35399a
Showing with 16 additions and 16 deletions
......@@ -4,7 +4,7 @@
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('/mTest/sw.js?V=2022120601')
.register('/mTest/sw.js?V=2022120602')
.then(() => { console.log('Service Worker Registered'); });
}
......@@ -13,7 +13,7 @@ var pwaT=null
let deferredPrompt;
const addBtn = document.querySelector('.add-button');
addBtn.style.display = 'none';
console.log(322232)
window.addEventListener('beforeinstallprompt', (e) => {
console.log(3232)
var ua = window.navigator.userAgent.toLowerCase();
......
self.addEventListener('install', (e) => {
// e.waitUntil(
// caches.open('footseen').then((cache) => cache.addAll([
// '/mTest/',
// '/mTest/index.html',
// '/mTest/index.js',
// ])),
// );
e.waitUntil(
caches.open('footseen').then((cache) => cache.addAll([
// '/mTest/',
// '/mTest/index.html',
// '/mTest/index.js',
])),
);
});
// self.addEventListener('fetch', (e) => {
// // console.log(e.request.url);
// e.respondWith(
// caches.match(e.request).then((response) => response || fetch(e.request)),
// );
// });
\ No newline at end of file
self.addEventListener('fetch', (e) => {
// console.log(e.request.url);
e.respondWith(
caches.match(e.request).then((response) => response || fetch(e.request)),
);
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment