Get User Agent  message breakdown

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"

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



mvp_badge
MVP

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

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.