WICG / background-fetch

API proposal for background downloading/uploading
https://wicg.github.io/background-fetch/
Apache License 2.0
281 stars 42 forks source link

Should web pages without service workers be able to use bgfetch? #148

Open youennf opened 4 years ago

youennf commented 4 years ago

(Note: I know this is a big departure from the current model of bgfetch).

I am curious if there is any interest in allowing pages to use bgfetch without having to register any service worker.

It seems that, ideally, we would have a layered model where bgfetch would allow basic functionality if service worker is not used/available, and advanced functionality if service worker is used.

jakearchibald commented 4 years ago

The reason this depends on SW is to provide a standard place to handle the events.

What's the alternative? If you fire them in a page, then you run the risk of dispatching them on a page without the correct event handler, which could happen for a load of reasons:

I guess the system could write directly to some form of storage, which might work in some cases, but that was discussed in https://github.com/WICG/background-fetch/issues/3.