diff --git a/index.html b/index.html index 4f288be58..a796c839b 100644 --- a/index.html +++ b/index.html @@ -49,7 +49,7 @@ - + 3.0 @@ -69,7 +69,7 @@ Score - + 3.0 @@ -103,7 +103,7 @@ Detailed Metrics - + 3.0 diff --git a/resources/main.mjs b/resources/main.mjs index 672fb8e68..f38753ec6 100644 --- a/resources/main.mjs +++ b/resources/main.mjs @@ -351,10 +351,18 @@ class MainBenchmarkClient { if (hash === "#home" || hash === "") { if (window.location.hash !== hash) window.location.hash = "#home"; + hash = "#home"; this._removeLocationHash(); } else { window.location.hash = hash; } + this._updateDocumentTitle(hash); + } + + _updateDocumentTitle(hash) { + const maybeSection = document.querySelector(hash); + const sectionTitle = maybeSection?.getAttribute("data-title") ?? ""; + document.title = `Speedometer 3 ${sectionTitle}`.trimEnd(); } _removeLocationHash() {