• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detect in app browser by user agent library

#1
Hello everyone,

I found following information about detecting in-app browser detection and wondered if it's possible to identify that information also by the user agent library?

https://stackoverflow.com/questions/1638...javascript

Thanks in advance
Reply

#2
This is not possible within the libraries CI provides. You can however create your own library to extend the default user agent library of CI. This should be relatively easy as it apparently requires a short amount of additional code.

In case of an Android application you need to know the exact applications' package name, which is pretty much a pain unless you want to detect a specific application (as far as I'm concerned).
Reply

#3
Unfortunately the $_SERVER['HTTP_X_REQUESTED_WITH'] is not an official PHP variable, but I managed to find some difference between the regular user agent string and the user agent string from an app.

Thanks for the input.
Reply

#4
(11-28-2017, 12:40 PM)Petrusilius Wrote: Unfortunately the $_SERVER['HTTP_X_REQUESTED_WITH'] is not an official PHP variable, but I managed to find some difference between the regular user agent string and the user agent string from an app.

Thanks for the input.

Nothing in $_SERVER that is prefixed with 'HTTP_' can be listed as an "official variable", because every such variable simply corresponds to HTTP headers that may or may not be sent by the client. That doesn't mean you can't use them, they're as standard as they can be.

But the fundamental issue here is that there's no reliable way to detect browsers from PHP, or any other server-side language - any info that you may get is self-reported. Browsers will by default send such headers to indicate what they are, but users can modify that behavior and either change the info string being sent, or turn it off entirely. In that sense, the User_agent library is actually useless for anything but cosmetics.

Only JavaScript, by virtue of being executed in the browser itself, can reliably tell you what the user agent is or what features it has.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.