Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge UserAgent support for BrowserId and BrowserVersion functions #626

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down