]> git.ardis.lu - alu.bz/commitdiff
Move redirect script earlier in the file
authorArdis Lu <ardisglu@gmail.com>
Sat, 21 Jan 2023 05:52:42 +0000 (21:52 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sat, 21 Jan 2023 05:52:42 +0000 (21:52 -0800)
<head> better reflects desired behavior and is a micro-optimization

index.html

index d6211048b98b16a70e7cabb9655cff56114166dd..8bb53417958a17ae57a377eebf7971916f347a6d 100644 (file)
   <link rel="icon" href="data:,">
   <link rel="stylesheet" href="style.css">
   <title>alu.bz</title>
+  <script>
+    (async () => {
+      if (location.pathname !== '' && location.pathname !== '/') {
+        location.replace(await fetch(`/api?${location.pathname.substring(1)}`).then(r => r.text()));
+      }
+    })();
+  </script>
 </head>
 
 <body>
     </dialog>
   </main>
 
-  <script>
-    (async () => {
-      if (location.pathname !== '' && location.pathname !== '/') {
-        location.replace(await fetch(`/api?${location.pathname.substring(1)}`).then(r => r.text()));
-      }
-    })();
-  </script>
   <script src="script.js" type="module"></script>
 </body>
 
This page took 0.036607 seconds and 4 git commands to generate.