Keep the scrollbar position after refreshing the page
Closed this issue · 3 comments
eight04 commented
- Open markdown file in the browser.
- Scroll down to somewhere.
- Edit the file and refresh the page to see the changes.
- 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.
KeithLRobertson commented
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!
eight04 commented
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.
KeithLRobertson commented
Thanks @Cimbali for implementing this feature!