]> git.ardis.lu - alu.bz/commitdiff
Prevent infinite back loop
authorArdis Lu <ardisglu@gmail.com>
Mon, 31 Oct 2022 02:35:55 +0000 (19:35 -0700)
committerArdis Lu <ardisglu@gmail.com>
Mon, 31 Oct 2022 02:35:55 +0000 (19:35 -0700)
.replace does not write current page to history

index.html

index e05145a4286ff448bbc70e480c99e165303dbae0..2cf69f0fe05e0a49b14b215b08b352a82b76f799 100644 (file)
@@ -71,7 +71,7 @@
   <script>
     (async () => {
       if (location.pathname !== '' && location.pathname !== '/') {
-        location = await fetch(`/api?${location.pathname.substring(1)}`).then(r => r.text());
+        location.replace(await fetch(`/api?${location.pathname.substring(1)}`).then(r => r.text()));
       }
     })();
   </script>
This page took 0.037124 seconds and 4 git commands to generate.