GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BigData-Tools/platform.js: A platform detection library that works on nearly all JavaScript platforms.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

228 Commits
228 Commits

Folders and files

NameName
Last commit message
Last commit date
doc
doc
 
 
test
test
 
 
vendor
vendor
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
bower.json
bower.json
 
 
package.json
package.json
 
 
platform.js
platform.js
 
 

Repository files navigation

Platform.js v1.0.0

A platform detection library that works on nearly all JavaScript platforms1.

Disclaimer

Platform.js is for informational purposes only and not intended as a substitution for feature detection/inference checks.

BestieJS

Platform.js is part of the BestieJS "Best in Class" module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, and plenty of documentation.

Documentation

The documentation for Platform.js can be viewed here: /doc/README.md

For a list of upcoming features, check out our roadmap.

Support

Platform.js has been tested in at least Chrome 531, Firefox 226, IE 6-11, Opera 9.2518, Safari 3-7, Node.js 0.6.210.10.24, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, and Rhino 1.7RC5.

Installation and usage

In a browser:

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

Via npm:

npm install platform

In Node.js and RingoJS:

var platform = require('platform');

In Rhino:

load('platform.js');

In an AMD loader like RequireJS:

require({
  'paths': {
    'platform': 'path/to/platform'
  }
},
['platform'], function(platform) {
  console.log(platform.name);
});

Usage example:

// on IE10 x86 platform preview running in IE7 compatibility mode on Windows 7 64 bit edition
platform.name; // 'IE'
platform.version; // '10.0'
platform.layout; // 'Trident'
platform.os; // 'Windows Server 2008 R2 / 7 x64'
platform.description; // 'IE 10.0 x86 (platform preview; running in IE 7 mode) on Windows Server 2008 R2 / 7 x64'

// or on an iPad
platform.name; // 'Safari'
platform.version; // '5.1'
platform.product; // 'iPad'
platform.manufacturer; // 'Apple'
platform.layout; // 'WebKit'
platform.os; // 'iOS 5.0'
platform.description; // 'Safari 5.1 on Apple iPad (iOS 5.0)'

// or parsing a given UA string
var info = platform.parse('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7.2; en; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 11.52');
info.name; // 'Opera'
info.version; // '11.52'
info.layout; // 'Presto'
info.os; // 'Mac OS X 10.7.2'
info.description; // 'Opera 11.52 (identifying as Firefox 4.0) on Mac OS X 10.7.2'

Author

twitter/jdalton
John-David Dalton

Contributors

twitter/mathias
Mathias Bynens

About

A platform detection library that works on nearly all JavaScript platforms.

mths.be/platform

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.