From cc4c6fa65ed3b8db88bad73ab761997db6bee29f Mon Sep 17 00:00:00 2001 From: elizondogenexus Date: Tue, 5 Jul 2022 11:35:55 -0300 Subject: [PATCH] change to recognize the edge ID (Edg/Edge/EdgA/Edgios) in the user agent sent from the browser issue:72284 --- .../dotnetframework/GxClasses/Core/GXApplication.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs b/dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs index b4ef99197..96b8eccf2 100644 --- a/dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs +++ b/dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs @@ -1950,6 +1950,10 @@ public int GetBrowserType() } if (userAgent != null) { + if ((userAgent.IndexOf("Edg")) != -1) + { + return BROWSER_EDGE; + } if (userAgent.ToUpper().IndexOf("CHROME") != -1) { return BROWSER_CHROME; @@ -1959,11 +1963,7 @@ public int GetBrowserType() { return BROWSER_FIREFOX; } - else if ((userAgent.IndexOf("Edge")) != -1) - { - return BROWSER_EDGE; - } - if ((userAgent.IndexOf("MSIE")) != -1) + else if ((userAgent.IndexOf("MSIE")) != -1) { if ((userAgent.IndexOf("Windows CE")) != -1) return BROWSER_POCKET_IE; @@ -2016,7 +2016,7 @@ public string GetBrowserVersion() if (type == BROWSER_EDGE) { - MatchCollection matches = Regex.Matches(userAgent, " Edge\\/([0-9]+)\\."); + MatchCollection matches = Regex.Matches(userAgent, " Edg[\\w]{0,3}\\/([0-9]+)\\."); if (matches.Count > 0) return matches[0].Groups[1].Value; }