about summary refs log tree commit diff stats
path: root/js/inknswitch/sw.js
blob: 4a63871533ac57b2e88b10cc62fa1370e6a0e374 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
self.addEventListener('install', function(event) {
    event.waitUntil(
      caches.open('inknswitch').then(function(cache) {
        return cache.addAll([
          './index.html',
          './ink.js',
          './android-icon-36x36.png',
          './android-icon-48x48.png',
          './android-icon-72x72.png',
          './android-icon-96x96.png',
          './android-icon-144x144.png',
          './android-icon-192x192.png',
          './apple-icon-57x57.png',
          './apple-icon-60x60.png',
          './apple-icon-72x72.png',
          './apple-icon-76x76.png',
          './apple-icon-114x114.png',
          './apple-icon-120x120.png',
          './apple-icon-144x144.png',
          './apple-icon-152x152.png',
          './apple-icon-180x180.png',
          './apple-icon-precomposed.png',
          './apple-icon.png',
        ]);
      })
    );
  });
  
  self.addEventListener('fetch', function(event) {
    event.respondWith(
      caches.match(event.request).then(function(response) {
        return response || fetch(event.request);
      })
    );
  });