if ( 'undefined' === typeof navigator.serviceWorker ) { console.log( "###### No service worker interface found" ); } else { navigator.serviceWorker.getRegistrations().then( function( registrations ) { console.log( "##### Removing old service workers" ); for( let registration of registrations ) { registration.unregister(); } } ); }