GithubHelp home page GithubHelp logo

browser-detector's Introduction

browser-detector

主要作用

  • 根据UA判断浏览器类型和版本,
  • 根据UA判断操作系统和版本号
  • 根据UA判断设备

检测支持

可检测浏览器

  • QQ浏览器
  • UC浏览器
  • 百度浏览器
  • 360浏览器
  • 猎豹浏览器
  • Vivaldi
  • Opera
  • Opera Mini
  • WebTV
  • Internet Explorer
  • Pocket Internet Explorer
  • Microsoft Edge
  • Konqueror
  • iCab
  • OmniWeb
  • Firebird
  • Firefox
  • Iceweasel
  • Shiretoko
  • Mozilla
  • Amaya
  • Lynx
  • Safari
  • Chrome
  • Navigator
  • GoogleBot
  • Yahoo! Slurp
  • W3C Validator
  • BlackBerry
  • IceCat
  • Nokia S60 OSS Browser
  • Nokia Browser
  • MSN Browser
  • MSN Bot
  • Netscape Navigator
  • Galeon
  • NetPositive
  • Phoenix
  • SeaMonkey
  • Yandex Browser
  • Comodo Dragon

可检测操作系统

  • Windows
  • Windows Phone
  • OS X
  • iOS
  • Android
  • Chrome OS
  • Linux
  • SymbOS
  • Nokia
  • BlackBerry
  • FreeBSD
  • OpenBSD
  • NetBSD
  • OpenSolaris
  • SunOS
  • OS2
  • BeOS

可检测设备

  • iPad
  • iPhone
  • Windows Phone
  • OPPO手机(OPPO)
  • 红米手机(Redmi)
  • 小米手机(XiaoMi)
  • 乐视手机(Letv)
  • Vivo手机(Vivo)
  • 三星手机(Samsung)
  • 华为手机(HuaWei)
  • 联想手机(Lenovo)
  • HTC
  • 魅族手机(Meizu)
  • 中兴手机(ZTE)
  • 一加手机(ONEPLUS)

安装

composer require apanly/browser-detector

使用

use apanly\BrowserDetector\Browser;
use apanly\BrowserDetector\Os;
use apanly\BrowserDetector\Device;

$browser = new Browser();

if ($browser->getName() === Browser::IE && $browser->getVersion() < 11) {
    echo 'Please upgrade your browser.';
}

$os = new Os();

if ($os->getName() === Os::IOS) {
    echo 'You are using an iOS device.';
}


$device = new Device();

if ($device->getName() === Device::IPAD) {
    echo 'You are using an iPad.';
}

说明

本项目大部分源码clone 参考资料的sinergi/php-browser-detector,主要是原项目无法适应**国情,需要修改,故此另开一个项目

Lecense

PHP Browser is licensed under The MIT License (MIT).

参考资料

browser-detector's People

Contributors

apanly 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

browser-detector's Issues

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.