Git Product home page Git Product logo

detect's Introduction

#detect.js ###provides the browser & os as a readable string.

About

This script uses the navigator.userAgent string to detect the browser. Since this string is easily altered by a user, detect.js should be used to alter the behavior of your javascript code. Instead, it should be used for displaying the likely browser information to the user.

Usage

Add detect.js to your page:

<script src="detect.js"></script>

Retrieve the browser, version, & os:

console.log( window.ui.browser );
console.log( window.ui.version );
console.log( window.ui.os );

window.ui

detect.js adds a 'ui' (short for user information) object to the window.

window.ui = {
    browser : 'Firefox',
    version : '6.0.2',
    os : 'Mac OS X 10.7'
}

Which browsers are supported?

Internet Explorer 6, 7, 8, 9, Mobile
Firefox 3.6, 4, 5, 6, 7, Mobile
Safari 3, 4, 5, Mobile
Opera 9, 10, 11, Mini, Mobile 
Chrome

Which operating systems can be detected?

Mac OS X
Windows
Linux
Android
iOS

detect's People

Contributors

benbscholz avatar tobsn avatar

Stargazers

 avatar

Watchers

 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.