# Firefox experiences Network Protocol Violation on Discourse based Websites

**URL:** <https://meta.discourse.org/t/firefox-experiences-network-protocol-violation-on-discourse-based-websites/97308>\
**Category:** Product Support\
**Created:** [September 16, 2018, 9:23pm UTC](https://meta.discourse.org/t/firefox-experiences-network-protocol-violation-on-discourse-based-websites/97308 "2018-09-16T21:23:30Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)\
**Post date:** [September 17, 2018, 1:28pm UTC](https://meta.discourse.org/t/firefox-experiences-network-protocol-violation-on-discourse-based-websites/97308/14 "2018-09-17T13:28:12Z")

</div>

> [@sam](#):
>
> Mozilla run a public Discourse @LeoMcA has anyone reported something like this to the Firefox bug tracker?

Not with Discourse in particular, but with ServiceWorkers in general. This looks to be the expected behaviour when a ServiceWorker errors out in Firefox, but it seems like Chrome lets them fail a little more gracefully:

> **[1256451 - make it easier to recover from a bad service worker](https://bugzilla.mozilla.org/show_bug.cgi?id=1256451)**
>
> RESOLVED (nobody) in Core - DOM: Service Workers. Last updated 2025-06-06.

> [@itsbhanusharma](#):
>
> Repro is easy if one has an external wifi adapter or something:

I can inconsistently repro this (with a fresh profile, on latest release Firefox) on my laptop by toggling my inbuilt wifi adapter on and off. I get the same error as here:

> [@GregoriusTech](#):
>
> I got a screenshot of the Firefox console with the actual error.

I’m no ServiceWorker expert, but I’m willing to bet the spare change in my coat pocket that this is being caused by this section of code:

[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/service-worker.js.erb#L91-L95](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/service-worker.js.erb#L91-L95)

I imagine in this weird network-changing state, `navigator.onLine` is returning true (despite it actually being false), and so an error is being thrown (rather than the offline page being shown) causing Firefox to display the corrupted content error.

Could we check if this error is a network error, and show the offline page in that case too? (Or even wait a little bit, and refresh the page for a user?)

---

_[View the full topic](https://meta.discourse.org/t/firefox-experiences-network-protocol-violation-on-discourse-based-websites/97308)._
