From fdbedfe021aca37dbb17c47fb613c2b9b4c134d9 Mon Sep 17 00:00:00 2001
From: Tom Smeding <tom@tomsmeding.com>
Date: Mon, 12 Jun 2023 23:05:22 +0200
Subject: unicode: Don't span history, replace history state

---
 modules/unicode/index.html | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'modules/unicode/index.html')

diff --git a/modules/unicode/index.html b/modules/unicode/index.html
index cb2beaa..924f86e 100644
--- a/modules/unicode/index.html
+++ b/modules/unicode/index.html
@@ -39,7 +39,11 @@ function do_lookup(override) {
 		if (input.length == 0) return;
 	}
 
-	location.hash = input;
+	if ("history" in window && "replaceState" in history) {
+		history.replaceState(null, "", "#" + input);
+	} else {
+		location.hash = input;
+	}
 
 	var xhr = new XMLHttpRequest();
 	xhr.onreadystatechange = function() {
-- 
cgit v1.2.3-70-g09d2