js/loader.js: preserve scrolling position...

...on autorefresh and reset it otherwise.

fixes #6285
fixes #6988