How to reliably detect online offline events with mv3 on firefox

You mean this event?

Note that Firefox doesn’t support service workers.
Instead, Firefox uses “non-persistent” background script, a.k.a. event page.
It has similar behavior like service worker (regarding lifetime).
But unlike service worker, it’s still a “normal webpage”, with full access to all “window / DOM” API.

So you probably don’t need to use a Offscreen document in Firefox, because you can use the API directly in the background script.