Giter Club home page Giter Club logo

browserdetection's People

Contributors

tomvision avatar wolfcast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browserdetection's Issues

EdgeHTML version and App version

getVersion for MS Edge is reporting 13.10586 whereas it's actually showing 25.10586.0.0 from the browser help>about section. I see that from https://en.wikipedia.org/wiki/Microsoft_Edge 13.10586 matches the 'EdgeHTML version' which appears to be the underlying browser platform version whereas 25.x is the app version that the user sees. Are we able to return app version? It doesn't look likely since I've read that the app version is not in the UA string.

I wanted to label this as a question but couldn't see how to do that.

_compatibilityViewVer

When set my IE (actual version 11.0.9600.19180) in Compatibility Mode,
The getIECompatibilityView() function returns always 7.0 as the Emulation Version number, regardless what Document Mode I set on the F12 Developer Tools.

Chrome browser detected as Android

Hi, keep up the good work. Just want to put this oddity I came across. A Samsung phone with the Chrome browser returns the OS and OS version (Android 11) for both browser and browser version.

Object
(
    [_agent:Wolfcast\BrowserDetection:private] => Mozilla\/5.0 (Linux; Android 11; SM-A105FN) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/111.0.0.0 Mobile Safari\/537.36
    [_browserName:Wolfcast\BrowserDetection:private] => Android
    [_compatibilityViewName:Wolfcast\BrowserDetection:private] => 
    [_compatibilityViewVer:Wolfcast\BrowserDetection:private] => 
    [_customBrowserDetection:Wolfcast\BrowserDetection:private] => Array()
    [_customPlatformDetection:Wolfcast\BrowserDetection:private] => Array()
    [_customRobotDetection:Wolfcast\BrowserDetection:private] => Array()
    [_is64bit:Wolfcast\BrowserDetection:private] => 
    [_isMobile:Wolfcast\BrowserDetection:private] => 1
    [_isRobot:Wolfcast\BrowserDetection:private] => 
    [_platform:Wolfcast\BrowserDetection:private] => Android
    [_platformVersion:Wolfcast\BrowserDetection:private] => 11
    [_robotName:Wolfcast\BrowserDetection:private] => 
    [_robotVersion:Wolfcast\BrowserDetection:private] => 
    [_version:Wolfcast\BrowserDetection:private] => 11
)

Android and Mobile Check

The user agent headers for a few of my Android devices aren't correctly being checked as Android platform or on mobile (the linux field is hitting first, so the android field is ignored).

Browser user agent: Mozilla/5.0 (Linux; Android 4.2.2; GT-I9505 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36

Switching the order for the checkPlatform() method to check for mobile first resolved this; however, I haven't tested the impact on all devices.

Missing information for Jolla and Sailfish OS

That would be the result of the __toString method of PHP:

User agent: Mozilla/5.0 (Maemo; Linux; U; Sailfish; Mobile; rv:38.0) Gecko/38.0 Firefox/38.0 SailfishBrowser/1.0
Browser name: Firefox
Browser version: 38.0
Platform family: Linux
Platform version: unknown
Platform version name: unknown
Platform is 64-bit: false
Is mobile: false
Is robot: false
IE is in compatibility view: false
Emulated IE version: Not applicable
Is Chrome Frame: false
Is AOL optimized: false
AOL version: Not applicable

I have the first edition of a Jolla phone and I do not know how this looks like with a Jolla C or one of those rare Jolla tables that might be in circulation. I am not sure whether there would be a difference.

How can I detect the platform version?

Is there any way I can detect what version of the platform the user has? Currently it will tell me the platform, but I would like to know the exact version of the platform as well.

Not following Semantic Versioning crashes our applications

In the past, my application crashed because you've made a breaking change in a minor version (from 2.5.1 to 2.9.0). Since then I've locked your package at 2.9.*, hoping this would never happen again.

With 2.9.5 you've released breaking changes in a patch version. If I didn't looked that up because of my experience with version 2.9.0, my application would have been crashed again.

Please, follow the semantic versioning pattern ( https://semver.org/ ) in the future!

Do you keep updating the code?

Do you keep updating the code? Last released this on 28 Nov 2016... It's now the 2nd of May 2018! This kind of script is only useful if it is up to date! Thanks...

Request : Add SSL/TLS Support

Hello,

Most of modern browser support SSL and TLS. Now only issue is at time of development, we need to check version for payment gateways. If you can add feature of SSL and TLS support like supports TLS1.2 or TLS1.1 then your class will be unique compare to others.

Filtering HTTP_USER_AGENT

Instead of: $agentString = $_SERVER['HTTP_USER_AGENT']; on line 619 I would suggest $agentString = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW) to prevent code injection and follow the PHP guidelines about access to global variables.

Question about licence

Hi, this library seems like a ton of great work. I was considering using it, but unfortunately GPL licence makes it not possible in most commercial projects. Original Chris's library was MIT and I wonder if it was your intention?

Googlebot smartphone not detected correctly

The following user agent for Googlebot is incorrectly detected as a real browser with no indication that the user is a robot

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

This was a user agent I saw in the web logs. More information can be seen here

The live demo reports

User agent: Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Browser name: Chrome
Browser version: 41.0.2272.96
Platform family: Android
Platform version: 6.0.1
Platform version name: Marshmallow
Platform is 64-bit: No
Is mobile: Yes
Is robot: No
IE is in compatibility view: No
Emulated IE version: Not applicable
Is Chrome Frame: No

I would expect the library to report Is robot: | Yes as a minimum.
Ideally, the Browser Name should report Googlebot, although it would be a shame to lose the information encoded in the User Agent. I'll leave this up to you :)

Thanks

Chrome IOS not detected

Hello,

It seems that chrome ios is not detected.
Below 2 different examples on 2 iphone :

object(BrowserDetection)#51 (12) {
 ["_agent":"BrowserDetection":private]=>
 string(142) "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) CriOS/68.0.3440.83 Mobile/15G77 Safari/604.1"
 ["_aolVersion":"BrowserDetection":private]=>
 string(0) ""
 ["_browserName":"BrowserDetection":private]=>
 string(6) "Safari"
 ["_compatibilityViewName":"BrowserDetection":private]=>
 string(0) ""
 ["_compatibilityViewVer":"BrowserDetection":private]=>
 string(0) ""
 ["_is64bit":"BrowserDetection":private]=>
 bool(false)
 ["_isAol":"BrowserDetection":private]=>
 bool(false)
 ["_isMobile":"BrowserDetection":private]=>
 bool(true)
 ["_isRobot":"BrowserDetection":private]=>
 bool(false)
 ["_platform":"BrowserDetection":private]=>
 string(6) "iPhone"
 ["_platformVersion":"BrowserDetection":private]=>
 string(7) "unknown"
 ["_version":"BrowserDetection":private]=>
 string(7) "unknown"
}
object(Wolfcast\BrowserDetection)#51 (12) {
  ["_agent":"Wolfcast\BrowserDetection":private]=>
  string(118) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
  ["_browserName":"Wolfcast\BrowserDetection":private]=>
  string(6) "Safari"
  ["_compatibilityViewName":"Wolfcast\BrowserDetection":private]=>
  string(0) ""
  ["_compatibilityViewVer":"Wolfcast\BrowserDetection":private]=>
  string(0) ""
  ["_customBrowserDetection":"Wolfcast\BrowserDetection":private]=>
  array(0) {
  }
  ["_customPlatformDetection":"Wolfcast\BrowserDetection":private]=>
  array(0) {
  }
  ["_is64bit":"Wolfcast\BrowserDetection":private]=>
  bool(false)
  ["_isMobile":"Wolfcast\BrowserDetection":private]=>
  bool(false)
  ["_isRobot":"Wolfcast\BrowserDetection":private]=>
  bool(false)
  ["_platform":"Wolfcast\BrowserDetection":private]=>
  string(9) "Macintosh"
  ["_platformVersion":"Wolfcast\BrowserDetection":private]=>
  string(7) "10.10.4"
  ["_version":"Wolfcast\BrowserDetection":private]=>
  string(5) "8.0.7"
}

Thanks for your help in advance !

MacOS Sonoma detected as Catalina

I noticed that the latest MacOS versions are not detected properly. I tried adding the following to the macVerToStr() method to add MacOS Sonoma and Ventura, but I must have something wrong, as it still detects my OS (MacOS 14.4.1 - Sonoma) as Catalina:

if ($this->_platformVersion === '10') {
            return 'Mac OS X'; //Unspecified Mac OS X version
        } else if ($this->compareVersions($macVer, '14.0') >= 0 && $this->compareVersions($macVer, '15.0') < 0) {
            return 'macOS Sonoma';
        } else if ($this->compareVersions($macVer, '13.0') >= 0 && $this->compareVersions($macVer, '14.0') < 0) {
            return 'macOS Ventura';
         ...

OS X Yosemite not detected

Safari Version 9.0.3 was correctly detected but the platform OS X Yosemite 10.10.5 on Macbook was not.

Chrome OS falsely detected as Android platform.

Hi, I should start by saying I'm a complete noob so I'm sorry if my inexperience shows here.

When I visit your demo page from a Chromebook (Lenovo C330) in Chrome, the platform family shows as Android. I was expecting it to show up as Chrome OS. It correctly identified the other platforms I tested (Android, iOS, Mac and Windows).

Is this result unavoidable due to the nature of Chrome OS? Or is it something you could add support for?

Thanks for making an otherwise awesome project that even my inexperienced self was able to add to my site. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.