Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eligrey opened this issue Oct 28, 2020 · 0 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed usability

Comments

@eligrey
Copy link
Member

eligrey commented Oct 28, 2020

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.

@eligrey eligrey changed the title penumbra.saveZip() should request unfetched resources with Background Fetch for rich download UI penumbra.saveZip() Background Fetch integration for rich download UI Oct 28, 2020
@eligrey eligrey added enhancement New feature or request help wanted Extra attention is needed usability labels Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed usability
Projects
None yet
Development

No branches or pull requests

1 participant