Permalink
Browse files

browser detection can now detect operating system

  • Loading branch information...
1 parent 5f8a388 commit 0cfa9175503483ffb0912d169f77606b0a5891ec @juzna committed Jan 13, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/prototype/prototype.js
@@ -83,7 +83,11 @@ var Prototype = {
Opera: isOpera,
WebKit: ua.indexOf('AppleWebKit/') > -1,
Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
- MobileSafari: /Apple.*Mobile/.test(ua)
+ MobileSafari: /Apple.*Mobile/.test(ua),
+ OS: {
+ Linux: (navigator.oscpu || navigator.platform).match(/Linux/i),
+ Windows: (navigator.oscpu || navigator.platform).match(/Windows/i)
+ }
}
})(),

0 comments on commit 0cfa917

Please sign in to comment.