Optimizers can get output in a JSON format at json?ua=….
Scores on the test summary page are not meant to be a measure of the quality of a browser, but to indicate how many features are available as a predictor of how much redundant code might be eliminated on that browser.
Is the global undefined really undefined
typeof undefined
Is the global Infinity set properly
Infinity === 1/0
Is the global NaN set properly
NaN !== NaN
Does "window" alias the global scope?
!!this.window && this === window
Is EcmaScript5 strict mode supported?
!(function () { return this; }.call(null))
typeof Array.slice
typeof Function.prototype.bind
Are getters/setters supported?
(function(){try{return(!!eval("({get x() { return true; }})").x);}catch(e){return(false);}})()
Does eval differ when used as a function vs. as an operator? See ES5 sec 15.1.2.1.1.
(function (undefined) { return (0,eval)("undefined") === 1; })(1)
None
Summary of JS features independent of browser APIs
Is JSON defined natively?
typeof JSON
None
None
typeof Date.prototype.toISOString
typeof Date.prototype.toJSON
typeof JSON !== "undefined" && JSON.stringify(false, function (x) { return !this[x]; }) === "true"
None
typeof atob
JSON and serialization support
typeof addEventListener
None
!!window.attachEvent
typeof document.createEvent
typeof document.createEventObject
!!document.createEventObject
Event APIs available.
typeof document.getElementsByClassName
typeof document.documentElement.getElementsByClassName
Is document.all present?
!!document.all
(function(){try{return(document.createElement('<input type="radio">').type === 'radio');}catch(e){return(false);}})()
typeof document.documentElement.compareDocumentPosition
typeof document.documentElement.contains
!!document.documentElement.contains
typeof document.createRange
typeof document.documentElement.doScroll
!!document.documentElement.doScroll
typeof document.documentElement.getBoundingClientRect
!!document.documentElement.getBoundingClientRect
"sourceIndex" in document.documentElement
Does setAttribute need only the two parameters?
document.body.setAttribute.length === 2
Does window.toStaticHTML exist?
typeof toStaticHTML
DOM APIs
typeof document.createElement('style').styleSheet
typeof document.body.style.cssText
typeof getComputedStyle
typeof document.body.currentStyle
!!document.body.currentStyle
CSS
None
!!window.XMLHttpRequest
typeof ActiveXObject
typeof postMessage
Network APIs
Do functions not leak dangerous info in negative indices?
void 0 === ((function(){})[-2])
Do function expressions not muck with the local scope?
void 0 === ((function(){var b,a=function b(){};return b;})())
Do finally blocks fire even if there's no catch on the stack.
(function () { try { throw null; } finally { return true; } })()
Do function scope frames for named functions not inherit from Object.prototype? http://yura.thinkweb2.com/named-function-expressions/#spidermonkey-peculiarity
0 === (function () { var toString = 0; return (function x() { return toString; })();})()
Do exceptions scope properly?
(function(){var e=true;try{throw false;}catch(e){}return e;})()
Are RegExps functions or objects?
'a'===('a'[0])
Are functions declared only if reachable?
(function(){var a;if(0)function a(){}return void 0===a;})()
Is __proto__ defined for objects?
typeof ({}).__proto__
Are format control characters lexically significant?
eval("'\u200d'").length === 1
Does string.split work properly -- no skipping blanks?
'a,,a'.split(',').length === 3
Is a trailing comma in an array ignored?
[,].length === 1
Does the length property of an array become enumerable after being set?
(function (a) { a.length = 0; for (var _ in a) { return false; } return true; })([0])
Is the arguments object an instanceof Array?
(function () { return arguments instanceof Array; })()
Safari makes arguments an Array but breaks concat.
(function () { return arguments instanceof Array && [].concat(arguments)[0][0] !== 1; })(1, 2)
Have enumerable keys been added to Object.prototype?
(function () { for (var _ in {}) return false; return true; })()
Do functions have a name property?
"name" in function () {}
Are inherited properties inumerable?
(function () { function c() {} c.prototype = {p:0}; return (new c).propertyIsEnumerable("p"); })()
Does eval violate integrity of closures?
(function (x) {return eval("x",function(x) {return function() { return x * 0; };}(true));}(false))
Can functions be used to generate RegExp replacements?
"-1 2.0".replace(/\S+/g, Math.abs) === "1 2"
(function () { for each (var k in [true]) { return k; } })()
Bugs & Oddities
|
Home |
FAQ |
API |
UA Parser |
News |
Browser Resources |
Code |
Submit a Bug |
Downloads |
Mailing List |
Contact