nextstrain/auspice.us

Offline Page "Refresh"

Opened this issue ยท 3 comments

Context

When travelling I might have a few JSONs I would like to inspect, check, or use for something. To do so dragging into auspice.us is often perfect (getting auspice to run locally sometimes is tricky). However, I have to remember to load up as many 'empty' auspice.us tabs as I think I might need beforehand, when I have internet.

Description

Would be cool if one had a button somewhere in auspice.us that clears whatever's displayed so one can drag on new JSONs without having to actually 'refresh' with internet connection.

Totally accept this is a little niche and the real solution is to figure out how to get auspice running locally more stably, but I bet I'm not the only one who relies more on auspice.us ! ;)

It would actually be quite possible to make auspice.us fully capable offline with service workers. That way you'd be able to open up as many auspice.us tabs as you want, when you need them, even offline. :-)

I started looking into this today, following Webpack's Progressive Web Application guide. Seems like it should be done on the Auspice side. Work in progress: nextstrain/auspice@19f5c2c...fe1ed19

Following the steps from the guide as-is does not work for Auspice. The service worker installs in the browser, but isn't accepting any network requests once the Auspice server shut down. There are two ways to approach this, which could happen simultaneously (as done today) and hopefully converge on a solution:

  1. Modify Webpack's demo app so that it stops working in the same way as Auspice. Doing this in a repo: victorlin/webpack-service-worker-demo
  2. Modify Auspice until it works. Since I'm not very familiar with this part of the project, this option feels more like shooting in the dark. This is today's shot: nextstrain/auspice@6dc1e03