@enplug/sdk-player
Advanced tools
Comparing version 0.5.0-dev2 to 0.5.0-dev3
{ | ||
"name": "@enplug/sdk-player", | ||
"version": "0.5.0-dev2", | ||
"version": "0.5.0-dev3", | ||
"description": "Enplug Player SDK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -40,7 +40,7 @@ /** | ||
.then(() => { | ||
console.log(`Offline support service worker v${config.cacheVersion} installed.`); | ||
console.log(`[<% app_name %>: SW] Offline support service worker v${config.cacheVersion} installed.`); | ||
self.skipWaiting(); | ||
}) | ||
.catch(() => { | ||
console.warn(`Error adding static resources to cache ${config.cacheVersion}.`, error); | ||
console.warn(`[<% app_name %>: SW] Error adding static resources to cache ${config.cacheVersion}.`, error); | ||
}) | ||
@@ -71,3 +71,3 @@ .then(() => cache.match('refreshTime')) | ||
if (cacheWhitelist.indexOf(cacheName) === -1) { | ||
console.log(`Deleting cache ${cacheName}`); | ||
console.log(`[<% app_name %>: SW] Deleting cache ${cacheName}`); | ||
return caches.delete(cacheName); | ||
@@ -90,3 +90,3 @@ } | ||
console.log(`[SW] URL to cache: ${cacheUrl}`); | ||
console.log(`[<% app_name %>: SW] URL to cache: ${cacheUrl}`); | ||
var cacheRequest = new Request(cacheUrl, { | ||
@@ -134,7 +134,7 @@ mode: 'cors' | ||
(cache) => { | ||
console.log(`Caching ${cacheUrl}.`); | ||
console.log(`[<% app_name %>: SW] Caching ${cacheUrl}.`); | ||
cache.put(cacheRequest, responseToCache); | ||
setCachedTime(cacheUrl); | ||
}, | ||
(error) => console.warn(`Unable to cache ${cacheUrl}`, error) | ||
(error) => console.warn(`[<% app_name %>: SW] Unable to cache ${cacheUrl}`, error) | ||
); | ||
@@ -146,3 +146,3 @@ | ||
(error) => { | ||
console.error('Fetched failed.', error, cachedResponse); | ||
console.error('[<% app_name %>: SW] Fetched failed.', error, cachedResponse); | ||
if (cachedResponse) { | ||
@@ -149,0 +149,0 @@ return cachedResponse; |
37804