mrdoob / system.js Goto Github PK
View Code? Open in Web Editor NEWJavaScript object with the user's system information.
License: MIT License
JavaScript object with the user's system information.
License: MIT License
Over on has.js we had a costly webgl test too, but some Chrome devs gave us a heads-up that a simpler test would require less spin up than
document.createElement( 'canvas' ).getContext( 'experimental-webgl' )
.
Instead you could check for the existence/type of window.WebGLRenderingContext
.
Found your library by accident when using bower install systemjs
to (hopefully) install systemjs
. While I can see the utility of your code, perhaps a better name is UserAgent.js
?
Once upon a time almost every application had UA sniffing code like this to detect the specific browser or browser version and execute polyfills or execute different calls. Those were dark times, man. Dark times.
There's this: https://github.com/systemjs/systemjs
How might yours work with theirs in harmony (no pun intended)?
We at VersionEye are working hard to keep up the quality of the bower's registry.
We just finished our initial analysis of the quality of the Bower.io registry:
7530 - registered packages, 224 of them doesnt exists anymore;
We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).
Sadly, your library mrdoob/system.js
is one of them.
Can you spare 15 minutes to help us to make Bower better?
Just add a new file bower.json
and change attributes.
{
"name": "mrdoob/system.js",
"version": "1.0.0",
"main": "path/to/main.css",
"description": "please add it",
"license": "Eclipse",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<dependency_name>": "<semantic_version>",
"<dependency_name>": "<Local_folder>",
"<dependency_name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.
NB! Please validate your bower.json with jsonlint before commiting your updates.
Thank you!
Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!
Some user agents that are Mobile Safari like
Mozila/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A101a Safari/419.3
or
Mozilla/5.0 (Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0_1 like Mac OS X; fr-fr) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20
won't be detected correctly.
The UA string should be able to tell you Mac OS X
or Mac OS
instead of just Macintosh
.
You have
navigator.userAgent.match( /ipod/i ) || navigator.userAgent.match( /ipad/i )
You should tighten up that code and use 1 regexp, something like:
var ua = navigator.userAgent;
if ( /iP[ao]d|iPhone/.test(ua) ) {
// ...
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.