This issue was WONTFIX'd https://bugs.chromium.org/p/chromium/issues/detail?id=753646 because "Chrome stops the service worker after 5+ minutes timeout even if it is streaming."
This means it's impossible to use service worker to serve a stream of a 2hr movie.
I feels like we should enable this somehow. Eg fetchEvent.waitUntil should be able to keep the service worker alive for as long as the fetch is in-progress.
Firefox also stops after a particular timeout (~5 minutes) regardless of extension promises even if no new functional events have been received.
I agree, though, long term streaming needs some kind of solution that does not result in abuse. I guess if closing the window that initiated the FetchEvent aborts the stream then maybe it would all just work.
In addition to @wanderview proposal, I would add some mechanism for the service worker provide a ceiling time estimation so the browser could notify the user properly.
Perhaps not showing the estimation but telling the user: "There are in-progress downloads, do you want to keep them in the background?" and re-prompt after that time expires: "The downloads are taking too much time, do you want to abort them?"
Most helpful comment
Firefox also stops after a particular timeout (~5 minutes) regardless of extension promises even if no new functional events have been received.
I agree, though, long term streaming needs some kind of solution that does not result in abuse. I guess if closing the window that initiated the FetchEvent aborts the stream then maybe it would all just work.