Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Jean-Pierre Brits
881
Views
3
Comments
How does one determine the current browser the user uses?
Question
Hi guys.
Check boxes and Multiple Choice controls do not show their populated values in Chrome when I set their enabled attributes to false. This works fine in internet explorer.
Do you have a solution to this issue? My other option is to determine the browser and show the values in a different way.
Thanks,
Jean-Pierre
João Pedro Abreu
Staff
Ideally, you'll be able to reach a solution that works on all browsers, since browser detection is not very reliable unless you use comercial solutions like
WURFL
, or
DeviceAtlas
.
That being said, browser detection is usually done by parsing the user agent string that is sent with a HTTP request and comparing it to known patterns used by browsers. If you open the
Silk UI Framework
, it contains an action (that isn't public), called
detectBrowser
and it does just that. I bet that action isn't public because it is not reliable, though.
Kilian Hekhuis
MVP
@Joao: I would think that in general, unless a browser deliberately tries to deceive you, it's pretty reliable detecting what you have in front of you by parsing the user agent.
@Jean-Pierre, can you post a minimal eSpace that shows this problem? I've never heard of this problem (and never experienced it), so I bet there must be something wrong with the code itself, rather than the browser.
João Pedro Abreu
Staff
@Killian: Browsers do try to deceive you! Coding for specific browsers is usually frowned upon by browser developers, so you have things like the MS Edge user agent string, which says it is compatible with every other major browser:
Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136
Of course it is still possible to detect that this string belongs to Edge, since it says
Edge
right there, but adding that check would require someone to write an additional line of code, which means realiable browser detection requires some maintenance effort and attention to new releases.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...