Hi Everyone,I have been referring to GetUserAgent doc
https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Environment?_gl=1*1nbnhkl*_ga*MTE1NTAxNzE5Ni4xNTg0MDQzOTYz*_ga_ZD4DTMHWR2*MTYyOTE0OTAxOS4xLjEuMTYyOTE0OTkxNi42MA..#GetUserAgent
But in the example, the message text is not clear
GetUserAgent() = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36"
GetUserAgent() = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299"
GetUserAgent() =
From the text the 'GetUserAgent' is retrieving; is my understanding that it is retrieving both browser and device information, for example in the above case it is windows. But why does it return multiple browsers for example in the second text block it returns Chrome, Safari and Edge.What is the reason for this and how should I drill down to which browser the user is actually using the application from?Thanks
Hi Isshaa,
That's a good question.
Please take a look at this post with a detailed explanation on how to extract the client browser from the user agent.
Kind regards,
João
Hi João,
I'm currently running into the problem that the GetBrowser() function detects Firefox and Chrome correctly, but it also returns 'chrome' when using it in Opera and Edge.
I have looked at the post you're referring to, GetBrowser() accepts no arguments (i.e. ToLower(GetUserAgent()) ), so using the function like this is not an option.
Do you have an idea what I'm doing wrong or could do differently to detect Opera and Edge correctly.
Eva
Hi Eva,
To be honest, I don't think I ever tried the GetBrowser function and in any case it should work and if it doesn't you should report in the OutSystems UI component (provided you are using the latest version since it might have been already fixed).
In any case, playing a bit with JavaScript, this snippet seems to work on Microsoft Edge:
window.navigator.userAgentData.brands[0].brand
Kind Regards,João
Hello @Isshaa Aarya,
Its a very good question and has been discussed before in the forums for e.g. here.
To get the browser info the consensus seems to be for using the 'GetBrowser' client action.
If you do end up using 'GetBrowser', please review the discussions in the thread I shared above for tips for e.g. on how to use it in Reactive apps etc.
Best regards,
AJ