diff options
| author | Fuwn <[email protected]> | 2026-01-23 17:58:44 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-23 17:58:44 -0800 |
| commit | 0cd4faa925fb0784ef2ae53621468371c510786c (patch) | |
| tree | dae6fd571792b466b6e7f22587fa7b31f26117d7 | |
| parent | fix: Resolve unused imports, dead code, and type definitions (diff) | |
| download | due.moe-0cd4faa925fb0784ef2ae53621468371c510786c.tar.xz due.moe-0cd4faa925fb0784ef2ae53621468371c510786c.zip | |
fix: Disable analytics on localhost or development environments
| -rw-r--r-- | src/app.html | 16 |
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; |