title: Service Worker does not work in most of mobile browsers
body: <p>I've got a static site with service worker onboard that is hosted at GitLab pages and perfectly works offline on my laptop but occasionally doesn't work offline almost in any mobile browser (works in Opera Mini, but not in mobile Chrome). So I'm trying to figure out what's wrong with it.</p>
  
  <p>My service worker registration script which invokes at index.html in the root of my site:</p>
  
  <pre><code>if ('serviceWorker' in navigator) {
    window.addEventListener('load', function() {
      navigator.serviceWorker.register('./serviceWorker.js').then(function (registration) {
        // Registration was successful
        console.log('ServiceWorker registration successful with scope: ', registration.scope);
      }, function (err) {
        // registration failed :(
        console.log('ServiceWorker registration failed: ', err);
      });
    });
  }
  </code></pre>
  
  <p>My service Worker itself:</p>
  
  <pre><code>let cache_v1 = 'cache_v1';
  
  self.addEventListener('install', function(event) {
    event.waitUntil(
      caches.open(cache_v1)
      .then(cache =&gt; cache.addAll(
        [
          './',
          './index.html',
          './favicon.png',
          './dist/bundle.js',
          './dist/style.css',
          './src/icons/soyuz_apollo192.png',
          './src/icons/soyuz_apollo_apple_icon.png',
          './src/img/asia.png',
          './src/img/pustota.jpeg',
          './src/img/zima-min.jpg'
        ]
      ))
    )
  })
  
  self.addEventListener('fetch', function(event) {
    event.respondWith(
      caches.match(event.request)
        .then(matching =&gt; {
          return matching || fetch(event.request)
        })
      )
  })
  </code></pre>
  
  <p>Tell me if there is something else you need to know to help</p>