Skip to content

lancevo/detectbrowser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

detect browser

A function to detect major browser type, version, and os.

See test page at http://lancevo.github.io/detectbrowser/test.html

var browser = detectBrowser(navigator.userAgent);

console.log('Browser name : ' + browser.name); // safari
console.log('Version : ' + browser.version);  // 5
console.log('Long Version : ' + browser.longVersion); // 5.0.2
console.log('Mobile ? : ' + browser.mobile);  // iphone
console.log('OS : ' + browser.os); //mac os x