Answer the question
In order to leave comments, you need to log in
Service Worker at Google Chrome Extension. I really want to, but it hurts?
Previously asked the question Why does caching not work?
The question concerns exactly the chrome extention.
I fetch templaters and they are not cached.
Then I remembered about sw and its power in appCatch.
He took his hands and pressed the buttons, it turned out.
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/js/sw.js').then(function(registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) {
console.log('ServiceWorker registration failed: ', err);
});
});
}
var CACHE_NAME = 'my-site-cache-v1';
var urlsToCache = [
'/html/templater/popUpId.tpl',
'/html/templater/bodyId.tpl',
'/html/templater/topNavLog.tpl',
'/html/templater/topNav.tpl',
'/html/templater/bodyFailedAuth.tpl',
'/html/templater/registration.tpl',
'/html/templater/login.tpl',
'/html/templater/syncToServ.tpl',
'/html/templater/syncToPc.tpl',
'/html/templater/emptySearch.tpl',
'/html/templater/updateButton.tpl',
'/html/templater/notification.tpl'
];
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open(CACHE_NAME)
.then(function(cache) {
return cache.addAll(urlsToCache);
})
);
});
ServiceWorker registration successful with scope
Uncaught (in promise) TypeError: Add/AddAll does not support schemes other than "http" or "https"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question