Only run code if 'serviceWorker' is in navigator