Skip to content

penumbra.saveZip() Background Fetch integration for rich download UI #162

Open
@eligrey

Description

@eligrey

We could add an optional resources field onto ZipOptions consisting of uninitialized RemoteResource descriptors. A Service Worker could handle downloading these resources with Background Fetch which enables us to create rich download UIs and persistent downloads that continue when the tab is closed.

Rich download UI example screenshot:

Screen Shot 2020-10-27 at 3 01 40 PM

Background Fetch example (from https://developers.google.com/web/updates/2018/12/background-fetch)

navigator.serviceWorker.ready.then(async (swReg) => {
  const bgFetch = await swReg.backgroundFetch.fetch('my-fetch', ['/ep-5.mp3', 'ep-5-artwork.jpg'], {
    title: 'Episode 5: Interesting things.',
    icons: [{
      sizes: '300x300',
      src: '/ep-5-icon.png',
      type: 'image/png',
    }],
    downloadTotal: 60 * 1024 * 1024,
  });
});

Limitations

This feature might not be compatible with use cases that involve an unknown amount of async paginated resources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions