ubershmekel / redditp

Convert any reddit page to a presentation or slide show
https://redditp.com
MIT License
261 stars 102 forks source link

Remember position in the slideshow #93

Open Atulin opened 4 years ago

Atulin commented 4 years ago

What the title says. Since links don't open in new tab automatically, and since the user might sometimes want to return to watching the slideshow after shutting down their device or closing the browser, a way to remember position would be only proper.

It can be handled 3 ways, far as I can tell:

The first solution seems to be the most straightforward, and it has the added benefit of the position in the slideshow being shareable and bookmarkable.

ubershmekel commented 4 years ago

Because of how reddit paginates, we might need to have an after=reddit-page-id in the URL too. But I agree with the rest of your notes. URL based would be best and the history event should replace the current url. I think this means that ?i=67 would actually be ?i=3 if at index 64 you were to have made the most recent paginated request. It would allow you to open the slideshow, but not necessarily to navigate backwards.

I'm saying that because I'm assuming you might be multiple requests in and you wouldn't want to wait for multiple reddit requests to paginate in. Or maybe you'd rather wait 3 seconds per 10 slides to more perfectly reconstruct your state?

Atulin commented 4 years ago

Personally, I'm fine with waiting a tad for the saved state to load.

ubershmekel commented 4 years ago

Another somewhat odd thing is that if you leave the tab open for a week, you might request a very in-depth page, making a lot of requests, but that page might not exist, or just have completely different content.