From 026adbebe59a0a9ea1f39a8da135534a2c2ae393 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Sat, 2 Mar 2024 14:29:02 +0000 Subject: Check OpenExternalWebBrowser custom flag better (#674) Properly check string prefix to see if we should open it in browser --- primedev/scripts/client/scriptbrowserhooks.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'primedev/scripts/client/scriptbrowserhooks.cpp') diff --git a/primedev/scripts/client/scriptbrowserhooks.cpp b/primedev/scripts/client/scriptbrowserhooks.cpp index 86b4a356..dcf051d2 100644 --- a/primedev/scripts/client/scriptbrowserhooks.cpp +++ b/primedev/scripts/client/scriptbrowserhooks.cpp @@ -9,7 +9,8 @@ void, __fastcall, (char* pUrl, char flags)) // clang-format on { bool bIsOriginOverlayEnabledOriginal = *bIsOriginOverlayEnabled; - if (flags & 2 && !strncmp(pUrl, "http", 4)) // custom force external browser flag + bool isHttp = !strncmp(pUrl, "http://", 7) || !strncmp(pUrl, "https://", 8); + if (flags & 2 && isHttp) // custom force external browser flag *bIsOriginOverlayEnabled = false; // if this bool is false, game will use an external browser rather than the origin overlay one OpenExternalWebBrowser(pUrl, flags); -- cgit v1.2.3