Question
Sun Life
CA
Last activity: 11 Jun 2023 11:24 EDT
How to identify browser type as Safari?
I have requirement to identify user logged in browser type as Safari/Chrome/Firefox etc..
There are some Pega OOTB functions available as below, but they are returning "true" irrespective of browser type.
- BrowserIsFireFoxOrSafari
- BrowserIsFireFox
Also, we have coded the below lines to get the browser type. However, there is an output when executed from Chrome but returning a null pointer exception in Safari.
List a = ((com.pega.pegarules.priv.PegaAPI)tools).getHTTPHeaders("sec-ch-ua");
outa = a.toString();
Please share some thoughts.