From e2c8c1d56c87ca46fdde4f9efe34559070a0bb0e Mon Sep 17 00:00:00 2001 From: Veiyna <89390497+Veiyna@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:42:14 +0200 Subject: [PATCH] Fixes TGUI not loading for newer 515 builds (#123) --- tgui/public/tgui.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tgui/public/tgui.html b/tgui/public/tgui.html index 3749c8b3c92..f70df7eb34d 100644 --- a/tgui/public/tgui.html +++ b/tgui/public/tgui.html @@ -47,8 +47,9 @@ // Basic checks to detect whether this page runs in BYOND var isByond = tridentVersion !== null && location.hostname === '127.0.0.1' - && location.pathname.indexOf('/tmp') === 0 && location.search !== '?external'; + //As of BYOND 515 the path doesn't seem to include tmp dir anymore if you're trying to open tgui in external browser and looking why it doesn't work + //&& location.pathname.indexOf('/tmp') === 0 // Version constants Byond.IS_BYOND = isByond; @@ -194,6 +195,8 @@ var len = styleSheets.length; for (var i = 0; i < len; i++) { var styleSheet = styleSheets[i]; + if(styleSheet.href === undefined) + continue; if (styleSheet.href.indexOf(url) !== -1) { return styleSheet.rules.length > 0; }