How to tell what browser user is using?
So this might be pretty basic, but is there a way to determine by workflow what browser a user is using? I've tried working with the GetRequestInfo activity, not sure what I'm doing though. Thanks for any pointers.
-
There is a Get Browser Info activity that has a userAgent output that does this.
--Ryan
1 -
Thanks for the reply!
I'm using old Workflow Designer at the moment, and the userAgent for the GetRequestInfo activity gives me something that looks like this when I check it in the external log:
user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
I'm get the same thing in Chrome or Firefox. Does the GetBrowserInfo activity in Workflow 5 give you something more specific to the user?
0 -
It sounds strange that you would get exactly the same result for different browsers. User agent strings are messy affairs and they do tend to look quite similar. Here's what I get:
- Chrome:
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
- Firefox:
- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
The Get Browser Info activity in Workflow 5 provides the same values.
There aren't any clean ways to test for the presence of a specific browser. Usually you just have to do a crude test with an expression like:
- userAgent.Contains("Chrome")
--Ryan
0 - Chrome:
-
Thanks again for the reply Ryan, that tells me what I needed to know
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
4 kommentarer