function setupNavigationScroll() {
  const scroller = document.getElementById('navigation-scroller');
  const navScrollPositionKey = 'navScrollPosition';

  if (scroller == null) {
    return;
  }

  window.addEventListener('unload', function () {
    const navScrollPosition = scroller.scrollTop;
    localStorage.setItem(navScrollPositionKey, navScrollPosition);
  });
  const previousScrollPosition = localStorage.getItem(navScrollPositionKey);
  if (previousScrollPosition != null) {
    scroller.scrollTop = previousScrollPosition;
  }
}
Preserve nav scroll position across page loads