From bebf4322c07b7e24f5c79440b75f4f4364119920 Mon Sep 17 00:00:00 2001 From: marvin Date: Sun, 13 Sep 2026 17:32:09 -0400 Subject: [PATCH] Fix browser back/forward navigation: push a history entry per view change instead of replacing it --- package.json | 2 +- src/public/app.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 93efa50..408bec4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "site-gateway", - "version": "0.11.52", + "version": "0.11.53", "private": true, "description": "Site Gateway: simple self-hosted website publishing, reverse proxying, and automatic HTTPS.", "type": "module", diff --git a/src/public/app.js b/src/public/app.js index d9a2cd5..ac4b443 100644 --- a/src/public/app.js +++ b/src/public/app.js @@ -248,7 +248,7 @@ async function loadFeatureView() { } function render() { const viewHash = state.view === "administration" ? `administration/${state.adminTab || "users"}` : state.view; - if (location.hash !== `#${viewHash}`) history.replaceState(null, "", `${location.pathname}${location.search}#${viewHash}`); + if (location.hash !== `#${viewHash}`) history.pushState(null, "", `${location.pathname}${location.search}#${viewHash}`); $("#hosted-count").textContent = state.sites.length; $("#proxy-count").textContent = state.proxies.length; $("#streaming-count").textContent = state.streams.length; $("#redirect-count").textContent = state.redirects.length; $("#access-count").textContent = state.accessLists.length; $("#certificate-count").textContent = state.certificates?.summary.total || 0; document.querySelectorAll("nav [data-view], .aside-utilities [data-view]").forEach(button => button.classList.toggle("nav-active", button.dataset.view === state.view)); const overview = state.view === "overview";