chore: fixes

This commit is contained in:
MattTheTekie 2026-04-23 18:45:08 -04:00
commit 902d54a078
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,39 @@
// legacy-redirect.js
(function () {
const legacyURL = "http://www.veltron.net/legacy.html";
const ua = navigator.userAgent || "";
// --- Target DSi / 3DS specifically ---
const isDSiOr3DS =
ua.includes("Nintendo DSi") ||
ua.includes("Nintendo 3DS");
// --- Optional broader legacy browser checks ---
const isOldIE =
ua.includes("MSIE") || ua.includes("Trident/");
const isOperaMini =
ua.includes("Opera Mini");
// Very old / limited mobile browsers fallback (optional)
const isVeryOldMobile =
/Android 2|Android 3|Symbian|webOS|BlackBerry/i.test(ua);
// Combine rules
const isLegacyBrowser =
isDSiOr3DS || isOldIE || isOperaMini || isVeryOldMobile;
// Prevent redirect loop
const alreadyOnLegacy =
window.location.href.startsWith(legacyURL);
// Optional override (useful for testing)
const bypass =
new URLSearchParams(window.location.search).has("noredirect");
if (isLegacyBrowser && !alreadyOnLegacy && !bypass) {
window.location.href = legacyURL;
}
})();