aboutsummaryrefslogtreecommitdiff
path: root/src/app.html
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-23 17:58:44 -0800
committerFuwn <[email protected]>2026-01-23 17:58:44 -0800
commit0cd4faa925fb0784ef2ae53621468371c510786c (patch)
treedae6fd571792b466b6e7f22587fa7b31f26117d7 /src/app.html
parentfix: Resolve unused imports, dead code, and type definitions (diff)
downloaddue.moe-0cd4faa925fb0784ef2ae53621468371c510786c.tar.xz
due.moe-0cd4faa925fb0784ef2ae53621468371c510786c.zip
fix: Disable analytics on localhost or development environments
Diffstat (limited to 'src/app.html')
-rw-r--r--src/app.html16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/app.html b/src/app.html
index 9f318135..7051b863 100644
--- a/src/app.html
+++ b/src/app.html
@@ -71,11 +71,17 @@
<meta name="msapplication-square310x310logo" content="mstile-310x310.png" />
<!-- Umami is a simple, fast, and privacy-focused alternative to Google Analytics. -->
- <script
- defer
- src="https://analytics.fuwn.me/script.js"
- data-website-id="d4bece6c-69c0-4c7b-89a9-e3a489cbef03"
- ></script>
+ <script>
+ if (!['localhost', '127.0.0.1'].includes(window.location.hostname)) {
+ const script = document.createElement('script');
+
+ script.defer = true;
+ script.src = 'https://analytics.fuwn.me/script.js';
+ script.dataset.websiteId = 'd4bece6c-69c0-4c7b-89a9-e3a489cbef03';
+
+ document.head.appendChild(script);
+ }
+ </script>
<script>
var global = global || window;