Giter VIP home page Giter VIP logo

agent's People

Contributors

bertkooij avatar caddydz avatar dan-har avatar doggieliu avatar elfsundae avatar evrard-c avatar jaybizzle avatar jenssegers avatar jonathan-bird avatar jwpage avatar kikopalomares avatar klgd avatar loclv avatar mpetty avatar nesk avatar nyholm avatar omranic avatar peter279k avatar sebastiaanspeck avatar skaronator avatar thadafinser avatar vinkla avatar yaoshanliang 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  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

agent's Issues

Update readme.md with serviceprovider

There is no mention of adding 'Jenssegers\Agent\AgentServiceProvider' to the providers section in /app/config/app.php in the Installation-portion of the readme.md

L5 compat.

Hi,

Do you have any plan on supporting L5 soon? :)

At this time, it throw this error : exception 'BadMethodCallException' with message 'Call to undefined method [package]'

Thanks :)

Same problem: isMobile does not exists

Hi.

I was trying to use your lib, but the method isMobile() was not available (the very same problem than this link: #20).

So, I used MobileDetect directly. I do not know what I did wrong, but MobileDirect worked fine.

Thank you.

Composer Update fails - No matching package

When running composer update from the terminal I get this error:

[Composer\DependencyResolver\SolverProblemsException]
    Problem 1
      - jeremeamia/SuperClosure 1.0.1 requires nikic/php-parser ~0.9 -> no matching package found.
      - laravel/framework 4.1.x-dev requires jeremeamia/superclosure 1.0.* -> satisfiable by jeremeamia/SuperClosure[
  1.0.1].
      - Installation request for laravel/framework 4.1.* -> satisfiable by laravel/framework[4.1.x-dev].
  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. 

If I remove the Laravel-Agent-package it works fine.

Below is my specific composer.json:

{
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/Zizaco/ardent.git"
    }
],
    "require": {
        "laravel/framework": "4.1.*",
        "way/generators": "dev-master",
        "schickling/backup": "dev-master",
        "zizaco/entrust": "dev-master",
        "intervention/image": "dev-master",
        "mobiledetect/mobiledetectlib": "dev-master",
        "jenssegers/agent": "*"
    },
    "require-dev": {
        "jason-morton-nz/laravel-grunt": "dev-master"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php",
            "app/libraries",
            "app/services"
        ]
    },
    "scripts": {
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-install-cmd": [
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "github-oauth": {
            "github.com": "secret"
        }
    },
    "minimum-stability": "dev"
}

Agent::agent() removed?

I was using Agent::agent() to return a full string of the user agent but that appears to have been removed now? If so why? Is there a better way of getting this?

Chrome OS Detection

Hello and good day,

I will be straightforward and I just want to report that your tool Sir cannot detect Chrome OS so far. Instead it returns 0.

Here is a sample user-agent for Chrome OS: 'Mozilla/5.0 (X11; CrOS x86_64 6680.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.102 Safari/537.36'.

Thanks a lot and may the Force be with you.

Current & Next-gens console

Hi,

I'm using this package and would have to detect console browsers. I found these:

For PS3:

Playstation 3 3.55
    Mozilla/5.0 (PLAYSTATION 3; 3.55)
Playstation 3 2.00
    Mozilla/5.0 (PLAYSTATION 3; 2.00)
Playstation 3 1.90
    Mozilla/5.0 (PLAYSTATION 3; 1.90)
Playstation 3 1.70
    Mozilla/5.0 (PLAYSTATION 3; 1.70)
Playstation 3 1.5
    Mozilla/5.0 (PLAYSTATION 3; 1.5)
Playstation 3 1.10
    Mozilla/5.0 (PLAYSTATION 3; 1.10)
Playstation 3 1.00
    Mozilla/5.0 (PLAYSTATION 3; 1.00)
    Mozilla/4.0 (PS3 (PlayStation 3); 1.00)
    Mozilla/5.0 (PLAYSTATION 3; 1.0)

For XBOX 360 and XBOX ONE:
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; Xbox)

For the Wii & Wii U:
Mozilla/5.0 (Nintendo WiiU) AppleWebKit/536.28 (KHTML, like Gecko) NX/*** NintendoBrowser/***.US

I'd love to be able to do Agent::isConsole(); and thought I could pull request it but would ask you about it first. What do you think?

Thanks!

Can't distinguish between Opera and Opera Mini

If i write {{Agent::browser()}} and I open the page with Opera, I see writing "Opera" and when i open it with Opera Mini on mobile, i also see writing "Opera".
Opera and Opera Mini are very different, it's important to distinguish both. I don't really know how to do it but analytics systems like GA or Piwik do it properly.
Is there an other way to do it using jenssegers / agent ?

Everything wrong with Windows Mobile Phone

Nothing is correct on Windows Mobile: nor the version, nor the browser, nor the platform.
Here is the code:

use Jenssegers\Agent\Agent;

$agent = new Agent();

$txt = "";

$browser = $agent->browser();
$platform = $agent->platform();

$txt .= "Browser: ".$browser."<br>";
$txt .= "Version: ".$agent->version($browser)."<br>";

$txt .= "Platform: ".$platform."<br>";
$txt .= "Version: ".$agent->version($platform)."<br>";
$txt .= "Useragent: ".$_SERVER['HTTP_USER_AGENT']."<br>";

echo $txt;

and here the output

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

Extenstion: Agent::isDesktop()

this would be a nice extension of this very nice package, otherwise I have to combine and negate isMobile & isTablet which isn't that readable

New "Mobile" detection

Should be added to the package this new detections?

Agent::isPhablet();
Agent::isLaplet();

it's not working for me

The mobile app built using QT hybrid application and we are not able to get it work using any of the following methods:

Agent::isMobile()
Agent::isTablet()
Agent::isAndroidOS()

The only method work is Agent::isDesktop() when sending the request using postman.

This is the current User-Agent value sent from the QT app : Mozilla/5.0
Any idea?

Do we have to setup the QT app to send some details about the user?

Thanks.

Using Agent on blade

Hi, i am new to laravel and I wonder if there is any way I can use the Agent directly on my blade file so that according to him I can change the type of content I'll use (so is better than having to use browserhack )

sorry for my english, google help me =]

Browser version

It could be great to have the browser's version ! ๐Ÿ’ƒ

Wrong browser on Safari user_agent

Example:

Mozilla/5.0 (iPhone; CPU iPhone OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H321 [FBAN/FBIOS;FBAV/45.0.0.45.96;FBBV/18289579;FBDV/iPhone5,4;FBMD/iPhone;FBSN/iPhone OS;FBSV/8.4.1;FBSS/2; FBCR/VIVO;FBID/phone;FBLC/pt_BR;FBOP/5]

is returning Mozilla on ->browser() method

Mobile detect error

In isMobile method the matchDetectionRulrsAgainstUA function is triggered without the parameters, and in this case the function itself returns false

laravel 5.3 and failed to install because of the vendor publish issue

I'm using laravel 5.3 and failed to install because

php artisan asset:publish vendor/package

[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "asset" namespace.

Script php artisan asset:publish vendor/package handling the post-update-cmd event returned with error code 1

Installation failed, reverting ./composer.json to its original content.

is there anyway I can install it on laravel 5.3?

Call to undefined method Application::bindShared

I've run composer update to update my laravel 4.0.X version to fix the sessions problems.

But now, when I try to run composer update or any php artisan command, I always receive this message:

PHP Fatal error: Call to undefined method Illuminate\Foundation\Application::bindShared() in /var/www/myapp/vendor/jenssegers/agent/src/AgentServiceProvider.php on line 31

This line, 31 is the following:

/**
 * Register the service provider.
 *
 * @return void
 */
public function register()
{
    $this->app->bindShared('agent', function($app)
    {
        return new Agent;
    });
}

Do you know how can I fix it?? It is really important

Thanks

Platform returns iOS on my Macbook Air

I'm using Laravel 4.1 and the latest version of Laravel-Agent (says 4.* in composer.json) and when I try:

var_dump(Agent::platform()) 

it says

string(3) "iOS"

And also Agent::isMobile() says true.

Any ideas on this?

Agent::isDesktop

I could use this method and it's very easy to implement since its just something like !isMobile && !isTablet

Support for Vivaldi

Would be nice if you could support Vivaldi (https://vivaldi.com/).

Here is the current data (same code as in #58)

Browser: Chrome
Version: 51.0.2704.103
Platform: Windows
Version: 10.0
Useragent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 Vivaldi/1.2.490.43

expected data:

Browser: Vivaldi
Version: 1.2.490.43
Platform: Windows
Version: 10.0

Broken on Laravel 5 (gasp!)

Although it's a bit taboo right now - this is of course broken on L5.

Easy to fix though. Remove the boot method from your provider. It's not needed. The package does not require any config or anything.

I have a fork and did just that and have been using it happily for probably a month.

Cheers!

Opera Browser Detection not working

Hello, I am new in using this library and somehow, it is good.

But in my testing, I discovered that it cannot detect Opera. It otherwise returned Google Chrome. When I looked in my database, the agent returned "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36 OPR/27.0.1689.76" and I guessed that the library reads the "Chrome" string and not the OPR. Please fix this issue.

Thanks.

isTablet not working correctly

Hi,

i setup this configuration

use Jenssegers\Agent\Agent;

$agent = new Agent();

if($agent->isMobile()){
    $realpath = "resources/mobile";
}
else{
    $realpath = "resources/desktop";
}

however, when i visit the application from an IPAD, i see the mobile version.

Thanks!

Call to undefined method

With Laravel 5 and Jenssegers installed you get this error:

Call to undefined method Jenssegers\Agent\Facades\Agent::platform()

Request code:

$agent = new \Agent;
return $agent->platform();

If I call it statically it returns false.

return \Agent::browser($request->header('user-agent'));

Note: this is a clean install with the latest Lavarvel 5.2.x and jenssegers/agent (v2.3.3)

isPhone check?

It would be nice to have a isPhone check. sure would look nicer than:

 (Agent::isMobile() && !Agent::isTablet())

Thanks!

Call To Undefinde Method

For every method I try to use with the Facade class I get the following error:

Call to undefined method Jenssegers\Agent\Facades\Agent::isMobile() (or similar )

Can anyone tell me how to solve this? I did include the Facade and the ServiceProvider in my app/config/app.php

Agent giving browser as 0 for some Apple devices

I have a few User Agents which I want to process like this:

"Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A403"

screen shot 2016-10-04 at 5 34 29 pm

Is there a way in which I can find the browser in these types of UAs

Mozilla/4.0 browser name "0" (ZERO)

Apologies if this is a known issue

UA string "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98 )"
Yields a browser name/version and os name/version of "0" (ZERO)

It doesn't occur too often, but I have about 300 page views on browser "0" for every 25,000 page views.

Add robot names

in Mobile_Detect.php on line 524:

    protected static $utilities = array(
        // Experimental. When a mobile device wants to switch to 'Desktop Mode'.
        // http://scottcate.com/technology/windows-phone-8-ie10-desktop-or-mobile/
        // https://github.com/serbanghita/Mobile-Detect/issues/57#issuecomment-15024011
        // https://developers.facebook.com/docs/sharing/best-practices
        'Bot'         => 'YandexBot|YandexImages|YandexVideo|YandexMedia|YandexBlogs|YandexFavicons|YandexWebmaster|YandexPagechecker|YandexImageResizer|YandexDirect|YaDirectFetcher|YandexCalendar|YandexSitelinks|YandexAdNet|YandexMetrika|YandexNews|YandexNewslinks|YandexCatalog|YandexAntivirus|YandexMarket|YandexVertis|YandexForDomain|YandexBot|Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor',
        'MobileBot'   => 'Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2',
        'DesktopMode' => 'WPDesktop',
        'TV'          => 'SonyDTV|HbbTV', // experimental
        'WebKit'      => '(webkit)[ /]([\w.]+)',
        // @todo: Include JXD consoles.
        'Console'     => '\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\b',
        'Watch'       => 'SM-V700',
    );

it's only Yandex bots added

YandexBot|YandexImages|YandexVideo|YandexMedia|YandexBlogs|YandexFavicons|YandexWebmaster|YandexPagechecker|YandexImageResizer|YandexDirect|YaDirectFetcher|YandexCalendar|YandexSitelinks|YandexAdNet|YandexMetrika|YandexNews|YandexNewslinks|YandexCatalog|YandexAntivirus|YandexMarket|YandexVertis|YandexForDomain|YandexBot

Tablet recognized as Mobile?

Hello.

When I call isMobile() on an iPad it returns true. Should this be the case?

I am using isMobile() and isTablet() to find out if the user is visiting my site with a mobile (eg: iPhone), tablet (eg: iPad) or PC, so I can serve different content, based on each device.

Why isn't iPad recognized as Tablet?

Thank you,
Ilias

Consider more extensive robot detection

Great library. We're using it in production. Have you considered extending the list of robots to include more possibilities? I would think any user agent string with the term 'bot' in it would do the trick.

Class 'App\Agent' not found

I installed using composer as in the description.

I tried composer dumpautoload, I reinstalled the package and still the same error.

I'm doing something wrong?

Mention: I use laravel 5.

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.