Skip to content

Commit

Permalink
Check OpenExternalWebBrowser custom flag better (#674)
Browse files Browse the repository at this point in the history
Properly check string prefix to see if we should open it in browser
  • Loading branch information
ASpoonPlaysGames authored Mar 2, 2024
1 parent ec5dc50 commit 026adbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion primedev/scripts/client/scriptbrowserhooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 026adbe

Please sign in to comment.