art-institute-of-chicago / browser-extension

Browser extension to view a random artwork from our collection in a new browser tab
GNU Affero General Public License v3.0
14 stars 6 forks source link

Hitting back button after new tab should show same artwork #14

Open IllyaMoskvin opened 5 years ago

nikhiltri commented 5 years ago

I'm not seeing a lot of options to set cache headers for the page that's served by the Chrome extension. We could use cookies to save the Data Hub response for, like, 10 seconds, but you wouldn't be able to cycle through works with browser's reload button anymore, which is a satisfying UX.

One alternative would be to cache a history of all the works a user has seen, and let people view their history. That would let people revisit works they may have seen a days ago. Still thinking it through.

seeReadCode commented 10 months ago

It looks like perhaps the cookies concept here has been abandoned.

IMHO the back functionality is less important than being able to access recently viewed art. (I often open a tab, jump to a site, and then realize I want to learn more about what I just saw for a split second).

Why not store the recently viewed art under a separate key in the local storage? Title and link should be enough. That could be added in updatePage. What do you think?

BTW, I'm looking at building a docker image that would feed CIA images to chromecast as a fill-in for the art gallery ambient mode (they haven't updated their art images in years).

Thanks for this extension!