Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

feat: Autoredirect to Excalidraw+ if special cookie is present (#5183)

Milos Vetesnikb9968e2e7208
diff --git a/public/index.html b/public/index.html
index d802ee0d6f..31e4ed5604 100644
--- a/public/index.html
+++ b/public/index.html
@@ -52,6 +52,25 @@
content="Excalidraw is a whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them."
/>
+ <script>
+ // Redirect Excalidraw+ users which have auto-redirect enabled.
+ //
+ // Redirect only the bare root path, so link/room/library urls are not
+ // redirected.
+ //
+ // Putting into index.html for best performance (can't redirect on server
+ // due to location.hash checks).
+ if (
+ window.location.pathname === "/" &&
+ !window.location.hash &&
+ !window.location.search &&
+ // if its present redirect
+ document.cookie.includes("excplus-autoredirect=true")
+ ) {
+ window.location.href = "https://app.excalidraw.com";
+ }
+ </script>
+
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<!-- Excalidraw version -->