Hey guys,
I use browser detection on one of the lps I use in some campaigns, however an interesting issue came up recently. I realized that MS Edge also includes Chrome, Safari etc in the useragent string. I was thinking about php for the coding and not javascript. One thing that's unique to Edge is that useragent has "Edge/{version_number}" in it.
Any coders can suggest the best way to detect this separately from Chrome and or Safari?
Just check for the 'Edge' string before checking the other browsers something like
if (navigator.userAgent.indexOf('Edge')>-1) { ...}
Is there a non-javascript solution mate?
in php should be something like
if (strpos($_SERVER['HTTP_USER_AGENT'],'Edge') !== false) {
...
}
just make sure you test this before testing for the other browsers otherwise you'll get matches for Safari or Chrome.
Cheers!! Will get it done.