How to detect client browser

Hi All,

Which is the most preferable way to detect client browsers ? I tried GetUserAgent() function and the result returned by the function is "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36". I got the above output for Chrome browser.



Chris Vorster wrote:

Hi Karthik!
Have a look at these two posts:

Hi Chris, I am using Outsystems 10 and how can i interpret safari browser using the function GetUserAgent() ?

Hi Karthik!

I have never used the GetUserAgent() function before (because the output is kinda weird to interpret - seems like it shows compatibility rather than current browser), so I would actually suggest using the GetBrowser action from OutsystemsUIWeb. The result is straightforward.

Daniël Kuhlmann wrote:


If you are using OutSystems UI you can get GetBrowser



Looked at several post regarding the topic and it suggests this approach. However, this only returns a blank text ("") to me. I am running a React application and I tried it on OnInitialize and OnReady to no avail.



Just got a script from stackoverflow and works for me for React:

// Internet Explorer 6-11
var isIE11 = /*@cc_on!@*/false || !!document.documentMode;

$parameters.IsIE11 = isIE11;