Firefox zeigt bei Discourse-basierten Websites einen Netzwerkprotokollverstoß an

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:

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:

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

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?)