October 2017
Intermediate to advanced
302 pages
7h 27m
English
Our asset-manifest.json returns, rather surprisingly, some JSON. Let's parse it:
self.addEventListener('install', event => { event.waitUntil( caches.open(CACHE_NAME) .then(cache => { fetch('asset-manifest.json') .then(response => { if (response.ok) { response.json().then(manifest => { }); } }) }); );});
Now we have a manifest variable that is a plain JavaScript object matching the content of asset-manifest.json.
Read now
Unlock full access