79829874

Date: 2025-11-25 15:23:31
Score: 2
Natty:
Report link
// Source - https://stackoverflow.com/a
// Posted by João Pimentel Ferreira, modified by community. See post 'Timeline' for change history
// Retrieved 2025-11-25, License - CC BY-SA 4.0

if ('serviceWorker' in navigator) {
  navigator.serviceWorker.register('./serviceWorker.js')
    .then(function(registration) {
      // Registration was successful
      console.log('ServiceWorker registration successful with scope: ', registration.scope);
    }).catch(function(err) {
      // registration failed :(
      console.log('ServiceWorker registration failed: ', err);
    });
}
Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Blacklisted phrase (1): :(
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Najbul Sekh