Answers for "Service Worker Navigator check"

CSS
0

Service Worker Navigator check

<script>
// Check that service workers are supported
if ('serviceWorker' in navigator) {
  // Use the window load event to keep the page load performant
  window.addEventListener('load', () => {
    navigator.serviceWorker.register('/service-worker.js');
  });
}
</script>
Posted by: Guest on October-02-2021

Browse Popular Code Answers by Language