GithubHelp home page GithubHelp logo

browser.js's Introduction

browser.js v0.5

最靠谱的浏览器嗅探方式

浏览器内核判断

browser.msie			//IE下返回IE的文档模式,怪癖模式返回5
browser.rv				//IE下返回真实的IE版本号
browser.WebKit			//Chrome或Safari等webkit内核浏览器下返回webkit版本号,其他返回false
browser.Opera			//Opera下 返回Opera版本号
browser.Gecko			//Firefox中返回Gecko版本号
browser.Chrome			//基于Chromium二次开发的浏览器中返回Chrome版本号,其他返回false

浏览器语言判断

browser.language		//返回浏览器语言,如“zh-CN”

浏览器外壳判断

browser.Safari			//Safari下返回Safari版本号,其他返回false
browser.Chrome			//Chrome下返回Chrome版本号,其他返回false
browser.Maxthon			//遨游高速模式返回版本号,其他返回false
browser.CoolNovo		//枫树浏览器高速模式返回版本号,其他返回undefined

特性:

  • 支持IE5-IE11、Webkit、gecko、Presto内核浏览器
  • 遵循define.amd\define.cmd标准,使用CommonJS或seajs时,自动注册为其匿名模块
  • 没有define时优先注册为$.browser或者window.browser
  • 能获取版本号的浏览器或内核的版本号时,优先返回版本号,无版本号返回bool值

browser.js's People

Contributors

gucong3000 avatar

Watchers

James Cloos avatar robyn avatar

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.