Cimbali/markdown-viewer

Keep the scrollbar position after refreshing the page

Closed this issue · 3 comments

  1. Open markdown file in the browser.
  2. Scroll down to somewhere.
  3. Edit the file and refresh the page to see the changes.
  4. The page always scrolls to top, and you have to scroll down again.

Or even better, add live-reload feature so there is no need to refresh the page.

Great idea, but I'm not sure the WebApi provides the resources to implement either functionality.
This is open source. If someone can figure out how to make it work, I'd be glad to accept a PR for it!

I'm pretty sure it's possible. I had implemented this feature on ansi-viewer. It saves the scrollbar position on unload event and restores the position when loaded. To live-reload, it just continuously sends XMLHttpRequest and re-render the page.

Thanks @Cimbali for implementing this feature!