Giter Club home page Giter Club logo

browser-detect's Introduction

Hi ๐Ÿ‘‹, I'm Varga Zsolt

WebArtisan since ~2003

  • ๐Ÿ”ญ Iโ€™m currently working on Artgen

  • ๐ŸŒฑ Iโ€™m currently learning Rust, Python, DSL, FP

  • ๐Ÿ‘จโ€๐Ÿ’ป My introduction page at https://hisorange.me

  • ๐Ÿ“ My Tech / Product Blog https://blog.artgen.io

  • ๐Ÿ’ฌ Ask me about Anything :D

  • ๐Ÿ“ซ How to reach me [email protected]

  • โšก Fun fact I love llamas <3


Connect with me:

varga-zsolt hisorange


hisorange hisorange


hisorange

browser-detect's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browser-detect's Issues

Problem when installing Laravel 5.4

When I updated to Laravel 5.4, I get this error when trying to vendor:publish:

  [Symfony\Component\Debug\Exception\FatalErrorException]              
  Call to undefined method Illuminate\Foundation\Application::share() 

And I get this error in my browser:

FatalErrorException in BrowserDetectService.php line 48:
Call to undefined method Illuminate\Foundation\Application::share()

What could this be? It has to do with this package because I did a fresh install without browser-detect and I have no problems.

OS version detects Browser Version

Here is a dump of the return of detect-method, but added a user-agent value to the array so you can see it all.

It says that OS version is 38.0.2125, but this is the Chrome version, not the OS version.

object(hisorange\BrowserDetect\Result)[330]
  protected 'attributes' => 
    array (size=18)
      'isMobile' => boolean false
      'isTablet' => boolean false
      'isDesktop' => boolean true
      'isBot' => boolean false
      'browserFamily' => string 'Chrome' (length=6)
      'browserVersionMajor' => int 38
      'browserVersionMinor' => int 0
      'browserVersionPatch' => int 2125
      'osFamily' => string 'OS X' (length=4)
      'osVersionMajor' => int 38
      'osVersionMinor' => int 0
      'osVersionPatch' => int 2125
      'deviceFamily' => string '' (length=0)
      'deviceModel' => string '' (length=0)
      'mobileGrade' => string '' (length=0)
      'cssVersion' => int 1
      'javaScriptSupport' => boolean true
      'user-agent' => string 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36' (length=121)

Only see "HiSoRange Generic Browser" - Laravel 5.3

Hi

I've tried to make this work for a few hours now with no success...

Followed your instructions.
hisorange\BrowserDetect\Provider\BrowserDetectService::class,
and
'BrowserDetect' => hisorange\BrowserDetect\Facade\Parser::class,

in app.php

but

 $result = \BrowserDetect::detect();
        dd($result);

shows me only

Result {#164 โ–ผ
  #attributes: array:17 [โ–ผ
    "isMobile" => false
    "isTablet" => false
    "isDesktop" => true
    "isBot" => false
    "browserFamily" => "HiSoRange Generic Browser"
    "browserVersionMajor" => 0
    "browserVersionMinor" => 0
    "browserVersionPatch" => 0
    "osFamily" => "HiSoRange Generic OS"
    "osVersionMajor" => 0
    "osVersionMinor" => 0
    "osVersionPatch" => 0
    "deviceFamily" => ""
    "deviceModel" => ""
    "mobileGrade" => ""
    "cssVersion" => 0
    "javaScriptSupport" => true
  ]
}

I tried it with Google Chrome and Firefox (both latest Windows versions), same result.

Is there anything I'm missing?

Using Laravel 5.3

thanks!

Can not install

Hello, I can not install this! :(

Your requirements could not be resolved to an installable set of packages.

Problem 1
- hisorange/browser-detect v0.9.0 requires yzalis/ua-parser dev-master -> no matching package found.
- hisorange/browser-detect 0.9.2 requires yzalis/ua-parser dev-master -> no matching package found.
- hisorange/browser-detect 0.9.1 requires yzalis/ua-parser dev-master -> no matching package found.
- Installation request for hisorange/browser-detect 0.9.* -> satisfiable by hisorange/browser-detect[0.9.1, 0.9.2, v0.9.0].

Potential causes:

Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Minor update to ReadMe

Hi there,

Was checking out your module on Laravel 4.2 and noticed that in your current read me you are using the artisan command for laravel 5.

I looked through your commits and found:

php artisan config:publish hisorange/browser-detect - for Laravel 4

Since you include version 1.* instructions, the above command works properly! Minor update. Thanks!

Detect Lumia

Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 630 Dual SIM) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537

  • "isMobile" => true
    
  • "isTablet" => false
    
  • "isDesktop" => false
    
  • "isBot" => false
    
  • "browserFamily" => "Internet Explorer"
    
  • "browserVersionMajor" => 0
    
  • "browserVersionMinor" => 0
    
  • "browserVersionPatch" => 0
    
  • "osFamily" => "AndroidOS"
    
  • "osVersionMajor" => 0
    
  • "osVersionMinor" => 0
    
  • "osVersionPatch" => 0
    
  • "deviceFamily" => "Nokia"
    
  • "deviceModel" => "iPhone"
    
  • "mobileGrade" => "A"
    
  • "cssVersion" => 0
    
  • "javaScriptSupport" => true
    

Browser version ending up being 0

I get the following result using Chrome:

isMobile: false,
isTablet: false,
isDesktop: true,
isBot: false,
browserFamily: "Chrome",
browserVersionMajor: 0,
browserVersionMinor: 0,
browserVersionPatch: 0,
osFamily: "MacOSX",
osVersionMajor: 0,
osVersionMinor: 0,
osVersionPatch: 0,
deviceFamily: "",
deviceModel: "",
mobileGrade: "",
cssVersion: 1,
javaScriptSupport: true

and in Safari

isMobile: false,
isTablet :false,
isDesktop:true,
isBot: false,
browserFamily: Safari,
browserVersionMajor: 0,
browserVersionMinor: 0,
browserVersionPatch: 0,
osFamily: MacOSX,
osVersionMajor: 0,
osVersionMinor: 0,
osVersionPatch: 0,
deviceFamily: "",
deviceModel: "",
mobileGrade: "",
cssVersion: 1,
javaScriptSupport: true

Can this bug be fixed somehow or am I the only one getting it?

ReflectionException: Class browser-detect.parser does not exist

Hi,
I'm using Laravel 4.2 and after installing your package I've got an error id if I use any BrowserDetect method, I receive the following error: ReflectionException Class browser-detect.parser does not exist
Do you have any hint on how to resolve this problem?
Thanks

Not able to find the windows phone

Hi ,
I am happy to follow the well builded code.thak you so much guys.you done a good job.i have to know this will work for windows phone?, and how can i do that.i am really new to laravel.i tried by windows phone.but it shows same android os.can u please help me.thak you so much.

Not working on lumen 5.2

I've used this :
$result = \BrowserDetect::detect(); & tried $result = BrowserDetect::detect();
but it returns :

Argument 1 passed to hisorange\BrowserDetect\Parser::__construct() must be an instance of Illuminate\Foundation\Application, instance of Laravel\Lumen\Application given, called in /home/vagrant/t2s-api/vendor/hisorange/browser-detect/src/Provider/BrowserDetectService.php on line 49 and defined

Here is the 4 list I have followed

app.php :
1. $app->register(hisorange\BrowserDetect\Provider\BrowserDetectService::class);
2. class_alias('hisorange\BrowserDetect\Facade\Parser', 'BrowserDetect');

Composer
3. { "require": { "hisorange/browser-detect": "2.*" } }

& Artisan
4. php artisan vendor:publish

Opera is detected as Chrome

Hey! Just got this issue: Opera on Mac (probably on Win too) detects as Chrome.

Chrome user agent string: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
Opera's: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36 OPR/33.0.1990.115"

Opera has additional "OPR/33.0.1990.115".

Yaml::parse() error when using BrowserDetect class

I updated composer yesterday and wherever I use this class, I get an error as follows:

ErrorException (E_UNKNOWN) The ability to pass file names to Yaml::parse() was deprecated in 2.2 and will be removed in 3.0. Please, pass the contents of the file instead.

Here is a sample code of what fails:

I am using browser-detect on a Laravel 4.x installation. As soon as I remove this, my page works fine.

Can't get it to work on larval 5

I've followed all the installation steps but i get this error

  Class 'App\Http\Controllers\BrowserDetect' not found

I'm trying to use it in a view in a controller like this:

  BrowserDetect::detect();

Please help! :3

showing safari , in chorme device toolbar

when i am testing it in to normal mode of chorme browser is showing chorme this is right but when i testing it into chorme device toolbar (iPhone 6s) it is showing safari. i tested many more package but this issue is showing in all packages and also in this package

Error in ObjectConfig.php: Argument must be array, null given

Great script, but I suddenly have trouble getting this package to work properly on Laravel 5. Here is the error thrown:

"ErrorException in /var/www/test-site/vendor/hisorange/traits/src/ObjectConfig.php line 70:
Argument 1 passed to hisorange\BrowserDetect\Parser::objectConfigImport() must be of the type array, null given, called in /var/www/test-site/vendor/hisorange/browser-detect/src/Parser.php on line 77 and defined (View: /var/www/test-site/resources/views/site/index.blade.php)"

The line causing the error on my index page is as follows:

My config\app.php is setup properly for both providers and aliases. I have even tried removing and then re-installing ~2.0 with composer, but I still get the error.

I'm not sure what is wrong. Any ideas or suggestions would be of great help. Any thoughts?

Error in Laravel 5.4

[2017-04-13 01:30:52] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::share()' in C:\wamp64\www\Direciona_SITE_2017\vendor\hisorange\browser-detect\src\Provider\BrowserDetectService.php:48
Stack trace:
#0 {main}

Too wide & not working workbench dependency

instead of:

 "laravel/framework": "4.*",

please use, e.g:
"Illuminate/Support": "4.*",

When I use your package as dependency in my workbench package, I have two copies of vendors: whoops error handlers because of too wide dependency. What is more after composer update I've got an error which corresponds to browser detect:

vagrant@homestead:~/Projects/hydra-app$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Error in exception handler: Undefined index: generic in /home/vagrant/Projects/hydra-app/workbench/hydra/core/vendor/hisorange/browser-detect/src/Parser.php:111Error in exception handler: Undefined index: generic in /home/vagrant/Projects/hydra-app/workbench/hydra/core/vendor/hisorange/browser-detect/src/Parser.php:111Error in exception handler: Undefined index: generic in /home/vagrant/Projects/hydra-app/workbench/hydra/core/vendor/hisorange/browser-detect/src/Parser.php:111vagrant@homestead:~/Projects/hydra-app$ 

Remove version from composer.json

You should not have the version bit in composer.json, because Packagist will not pick up newer releases, since the composer.json is stuck at 2.0.2

as an added bonus when you tag new releases in git, they should automatically be picked up by packagist, no further intervention needed.

Opera issue

Using this package for my site to check if browser is Desktop, Tablet or Mobile and in opera I get the following:

ErrorException
touch(): Utime failed: Permission denied (View: /home/*/**//****/index.blade.php)

This is the site and works well in Chrome, FF, but in Opera I get the error.
http://letsgomacedonia.com

You might be interested to check.
Best regards,

iPad detected as mobile

The user agent Mozilla/5.0 (iPad; CPU OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B410 Safari/600.1.4 gets detected as mobile not tablet.

Result from user agent:

isMobile: true
isTablet: false
isDesktop: false
isBot: false
browserFamily: Safari
browserVersionMajor: 8
browserVersionMinor: 0
browserVersionPatch: 0
osFamily: iPhone OS
osVersionMajor: 8
osVersionMinor: 0
osVersionPatch: 0
deviceFamily: iPad
deviceModel: iPad
mobileGrade: A
cssVersion: 3
javaScriptSupport: true

Not Working on L 5.2

I've used this command :
$result = \BrowserDetect::isMobile();
but it returns :
Class 'BrowserDetect' not found

Here is my app.php :
providers' => [
hisorange\BrowserDetect\Provider\BrowserDetectService::class,
]

And Alias is :
aliases' => [
'BrowserDetect' => hisorange\BrowserDetect\Facade\Parser::class,
]

Any ideas?

Detect javscript

Hey, thanks for all your work on this, it's very usefull to integrate detect quiclky in new laravel project !

Do you thinks you could add javascript detection (enable or not) in forthcoming versions?

L5.4 - Call to undefined method Illuminate\Foundation\Application::share()

I'm using Laravel 5.4. When I run php artisan vendor:publish it gives me following error:

[Symfony\Component\Debug\Exception\FatalThrowableError] Call to undefined method Illuminate\Foundation\Application::share()

I've the quick solution to this problem. I will raise a pull request. Please consider merging my code in your upcoming release.

Not working with native apps.

Hello.
I am using this as API in my application.

$agent = BrowserDetect::detect();
return Response()->json(ResponseManager::getResult($agent, 10, ''));

Everything working fine but when i try to call using android native app then this would return wrong result. So is there any possibilities to how to get accurate result with native apps.

Thanks

Windows 10 wrong detection

Hi,

I've tested BrowserDetect::browserFamily() using Chrome browser in Windows 7 and it returns Chrome which is correct. However in Windows 10 it returns Hisorange Generic Browser. Is there any solution to this that I can do on my side?

Thanks.

Laravel 5 support

Laravel 5 should be out next week, is the support planned or should I create a pull request? :)

Local use

Is it normal that i always have default results on my local application?

Browser Version Numbers Not Pulling Through

I'm using this in conjunction with an auth package for Laravel. (https://github.com/rajivseelam/api-laravel-sentry)

I'm currently testing my API I'm creating and I'm strictly using POSTMAN to do so. I noticed, however in each token request where BrowserDetect object is fired off, the versioning doesn't come through.

Could it be just a problem with POSTMAN? I'll follow up when I'm implementing AJAX calls into a front-end.

Browser version is not shown

Hello,

I'm using Laravel 5.1.27

When I do this:

var_dump(\BrowserDetect::browserVersion());

I get a empty string.

Even if I do this:

$browser = \BrowserDetect::detect()->toArray();
dd($browser);

The versions (major, minor, patch) of browser and os, it is always zero.

I tried this with Chrome, Firefox and Safari on a MacBook.

Or maybe this is normal when I see an application locally?

Thanks.

Error after composer update

Hi, I've just update through the composer and I got the current error:

Argument 1 passed to hisorange\BrowserDetect\Parser::objectConfigImport() must be of the type array, null given, called in C:\xampp\htdocs\greekhotelsapi\vendor\hisorange\browser-detect\src\Parser.php on line 77 and defined (View: C:\xampp\htdocs\greekhotelsapi\resources\views\homepage.blade.php)

I'm only using these examples: BrowserDetect::isTablet(), BrowserDetect::isDesktop(), BrowserDetect::isMobile(), and everything seemed to be working just fine before.

Could you please advice?

Package rewamp. Future plans.

I promise I will rewamp the whole package one day and fix the issues with the versioning and the tablet detecting. But right now I am not working with Laravel at all, and I have no plans to return to it, so the package will be independent, but ofc will still keep the Laravel support just in a different manner.

!!! This does not mean the package is broken, only minor issues but the issue is connected to the way how I manage plugins atm. In the future I plan to make a different model which is more flexible and easier to support across different frameworks.

iPad is being detected as mobile instead of tablet

Hi mate, first of all thanks for you work, it's awesome!
I'm using it in production in a site called Resermap (www.resermap.com) and it's detecting that the iPad is a mobile (redirecting it to the mobile web site) instead of keeping it in the regular (responsive) website, as a tablet should do.
Do I have to configure something else for this to work as I mention?
Thanks again!

Platform Call

Add a call ->platform to return (desktop,tablet,mobile,bot)

Minimum stability

Hello,
I'm trying to install browser-detect on my Laravel 4.1 and I'm unable to install the dev-master version nor the 0.9.2.

$ php composer.phar update                      
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for hisorange/browser-detect 0.9.2 -> satisfiable by hisorange/browser-detect[0.9.2].
    - hisorange/browser-detect 0.9.2 requires yzalis/ua-parser dev-master -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

I have "minimum-stability": "stable" specified in my composer.json and I for safety I want to keep it. Is it possible to make a stable release?

Ipad Version

Hi,

I'm testing the tablet detection with BrowserDetect::detect() and BrowserDetect::isTablet(). When I use desktop version or mobile, it's work, but if I used iPad, dosen't work, BrowserDetect::isTablet() return false.

I try with iPad 2. I am doing something wrong?

Regards!

updating from dev-master to 1.* causing error

I've had the most recent "dev-master" version installed. I wanted to update to "1.*" and am getting the following error:

Updating dependencies (including require-dev)

  • Installing hisorange/traits (dev-master b91633e)
    Loading from cache
  • Removing garetjax/phpbrowscap (dev-master ed66171)
  • Installing garetjax/phpbrowscap (2.0)
    Loading from cache
  • Removing hisorange/browser-detect (dev-master 4000aa9)
  • Installing hisorange/browser-detect (dev-develop-1 c4e2619)
    Loading from cache

Writing lock file
Generating autoload files
PHP Fatal error: Class 'hisorange\browserdetect\Providers\BrowserDetectServiceProvider' not found in /usr/share/nginx/picantewsdev/html/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 158
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'hisorange\browserdetect\Providers\BrowserDetectServiceProvider' not found","file":"/usr/share/nginx/picantewsdev/html/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php","line":158}}{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'hisorange\browserdetect\Providers\BrowserDetectServiceProvider' not found","file":"/usr/share/nginx/picantewsdev/html/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php","line":158}}Script php artisan clear-compiled handling the post-update-cmd event returned with an error

[RuntimeException]
Error Output: PHP Fatal error: Class 'hisorange\browserdetect\Providers\BrowserDetectServiceProvider' not found in /usr/share/nginx/picantewsdev/html/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line
158

Issues with publish config files

php artisan vendor:publish
Copied File [/vendor/hisorange/browser-detect/src/config/config.php] To [/config/hisorange/browser-detect/browser-detect-config.php]
Copied File [/vendor/hisorange/browser-detect/src/config/plugins.php] To [/config/hisorange/browser-detect/browser-detect-plugins.php]

Publishing Complete!

This generates config files under "/config/hisorange/browser-detect/" folder where you use /config/ folder ...
Hopes you can resolve the issue.

Error on Laravel 5.4

local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::share()' in C:\myProject\vendor\hisorange\browser-detect\src\Provider\BrowserDetectService.php:48

Please! How can I solve this?

can't install- failed dependencies

Trying to install this package in a new Laravel 4 installation, it's failing on one of the dependencies?

Problem 1
- Installation request for hisorange/browser-detect 1.* -> satisfiable by hisorange/browser-detect[1.0.1].
- hisorange/browser-detect 1.0.1 requires hisorange/traits dev-master -> no matching package found.

Doesn't work for tablets.

BrowserDetect::isTablet() doesn't return anything. Checked it on chrome's emulator and Apple Ipad

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.