if ('serviceWorker' in navigator){
  window.addEventListener('load', function(){
    navigator.serviceWorker.register('/pwa/service-worker.js').then(function(reg){
      console.log('SW registered', reg);
    }).catch(function(err){ console.warn('SW reg failed', err); });
  });
}