# Disable service worker initializer

**URL:** <https://meta.discourse.org/t/disable-service-worker-initializer/116392>\
**Category:** Development\
**Created:** [April 30, 2019, 3:59am UTC](https://meta.discourse.org/t/disable-service-worker-initializer/116392 "2019-04-30T03:59:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Jacky\_Cheng](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jacky_cheng/32/139694_2.png) [@Jacky\_Cheng](https://meta.discourse.org/u/Jacky_Cheng)\
**Post date:** [April 30, 2019, 4:20am UTC](https://meta.discourse.org/t/disable-service-worker-initializer/116392/5 "2019-04-30T04:20:50Z")

</div>

```
       if (
          registration.active &&
          !registration.active.scriptURL.includes(
            Discourse.ServiceWorkerURL
          )
        ) {
          registration.unregister();
        }

```

shouldn’t this if condition to be this one to only unregister Discourse ServiceWorker ?

```
           if (
              registration.active &&
              registration.active.scriptURL.includes(
                Discourse.ServiceWorkerURL
              )
            ) {
              registration.unregister();
            }

```

---

_[View the full topic](https://meta.discourse.org/t/disable-service-worker-initializer/116392)._
