This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 192
/
core.html
82 lines (65 loc) · 44.6 KB
/
core.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!doctype html>
<body>
<style>
<!--
/*
The following CSS rule is for deliberately changing the layout of number fields in Webkit.
This makes sure that if the field has a spin button, it will change the size of wrapping
elements, which will be detected by the test suite.
*/
input[type=number]::-webkit-outer-spin-button {
display: inline;
padding: 60px;
}
-->
</style>
<script src='/scripts/useragents.js' type='text/javascript'></script>
<script>
Browsers = new UserAgents(navigator.userAgent);
Test30=(function(){function F(J){this.initialize(J)}F.prototype={suites:[[B,w,u,D,j,p,z,G,t,b,n,l],[q,d,c,f,A,k,h,a,e],[E,I]],initialize:function(J){this.backgroundTasks={};this.callback=J;this.results=new y(this);for(g in this.suites){for(s in this.suites[g]){new (this.suites[g][s])(this.results)}}this.waitForBackground()},waitForBackground:function(){var J=this;window.setTimeout(function(){J.checkForBackground.call(J)},300)},checkForBackground:function(){var K=0;for(var J in this.backgroundTasks){K+=this.backgroundTasks[J]}if(K){this.waitForBackground()}else{this.finished()}},startBackground:function(J){this.backgroundTasks[J]=1},stopBackground:function(J){this.backgroundTasks[J]=0},finished:function(){var L=[],M=[];K(0,"",this.results);function K(Q,P,O){if(O.items){for(i in O.items){if(Q==0){M.push(O.items[i].data.id+"="+O.items[i].points+"/"+O.items[i].max+"+"+O.items[i].bonus)}if(typeof O.items[i].data.passed!="undefined"){L.push(P+O.items[i].data.id+"="+(!!O.items[i].data.passed?1:0))}if(O.items[i].items){K(Q+1,P+O.items[i].data.id+"-",O.items[i])}}}}var J=new Date;var N=J.getTime()+"_"+(((1+Math.random())*65536)|0).toString(16).substring(1);this.callback({uniqueid:N,score:this.results.points,bonus:this.results.bonus,results:L.join(","),points:M.join(","),maximum:this.results.max})}};function y(J){this.initialize(J)}y.prototype={initialize:function(J){this.parent=J;this.items=[];this.points=0;this.bonus=0;this.max=0;this.backgroundTasks=0;this.update()},startBackground:function(J){this.parent.startBackground(J)},stopBackground:function(J){this.parent.stopBackground(J)},getSection:function(K){var J=new m(this,K);this.items.push(J);return J},update:function(){var L=0;var M=0;var J=0;for(var K=0;K<this.items.length;K++){L+=this.items[K].getPoints();M+=this.items[K].getBonus();J+=this.items[K].getMaximum()}this.points=L;this.bonus=M;this.max=J},retrieve:function(){var K={points:this.points,bonus:this.bonus,items:{}};for(var J=0;J<this.items.length;J++){K.items[this.items[J].data.id]=this.items[J].retrieve()}return K}};function m(J,K){this.initialize(J,K)}m.prototype={initialize:function(J,K){this.items=[];this.points=0;this.bonus=0;this.max=0;this.parent=J;this.data=K},startBackground:function(J){this.parent.startBackground(J)},stopBackground:function(J){this.parent.stopBackground(J)},setItem:function(J){var K=new H(this,J);this.items.push(K);this.update();return K},getGroup:function(K){var J=new o(this,K);this.items.push(J);return J},update:function(){var L=0;var M=0;var J=0;for(var K=0;K<this.items.length;K++){L+=this.items[K].getPoints();M+=this.items[K].getBonus();J+=this.items[K].getMaximum()}this.points=L;this.bonus=M;this.max=J;this.parent.update()},getBonus:function(){return this.bonus},getPoints:function(){return this.points},getMaximum:function(){return this.max},retrieve:function(){var K={points:this.points,bonus:this.bonus,items:{}};for(var J=0;J<this.items.length;J++){K.items[this.items[J].data.id]=this.items[J].retrieve()}return K}};function o(J,K){this.initialize(J,K)}o.prototype={initialize:function(J,K){this.items=[];this.points=0;this.bonus=0;this.max=0;this.data=K;this.parent=J},update:function(){var N=0;var P=0;var J=0;var O=0;var K=true;var M=false;for(var L=0;L<this.items.length;L++){N+=this.items[L].getPoints();P+=this.items[L].getBonus();J+=this.items[L].getMaximum();O+=this.items[L].getPassed()?1:0;if(this.items[L].getRequired()){K&=this.items[L].getPassed()}M|=this.items[L].getPartiallyPassed()}if(!K){N=0}this.points=N;this.bonus=P;this.max=J;this.parent.update()},startBackground:function(J){this.parent.startBackground(J)},stopBackground:function(J){this.parent.stopBackground(J)},setItem:function(J){var K=new H(this,J);this.items.push(K);this.update();return K},getBonus:function(){return this.bonus},getPoints:function(){return this.points},getMaximum:function(){return this.max},retrieve:function(){var K={points:this.points,bonus:this.bonus,items:{}};for(var J=0;J<this.items.length;J++){K.items[this.items[J].data.id]=this.items[J].retrieve()}return K}};function H(J,K){this.initialize(J,K)}H.prototype={initialize:function(J,K){this.parent=J;this.data=K;if(typeof this.data.value=="undefined"){this.data.value=0}if(typeof this.data.bonus=="undefined"){this.data.bonus=0}if(typeof this.data.award=="undefined"){this.data.award=this.data.value}},update:function(J){for(key in J){this.data[key]=J[key]}if(typeof this.data.value=="undefined"){this.data.value=0}if(typeof this.data.bonus=="undefined"){this.data.bonus=0}if(typeof this.data.award=="undefined"){this.data.award=this.data.value}this.parent.update()},startBackground:function(){this.parent.startBackground(this.data.id)},stopBackground:function(){this.parent.stopBackground(this.data.id)},getBonus:function(){return this.data.bonus},getPoints:function(){return this.data.passed?this.data.award:0},getMaximum:function(){return this.data.value},getPassed:function(){return this.data.passed},getPartiallyPassed:function(){if(this.data.custom&&this.data.custom=="partial"){return true}return this.getPassed()},getRequired:function(){return !!this.data.required},retrieve:function(){var J={points:this.getPoints(),bonus:this.getBonus()};return J}};var x=(function(){var K={select:"input",change:"input",input:"input",submit:"form",reset:"form",forminput:"form",formchange:"form",error:"img",load:"img",abort:"img"};function J(L,N){N=N||document.createElement(K[L]||"div");L="on"+L;var M=(L in N);if(!M){if(!N.setAttribute){N=document.createElement("div")}if(N.setAttribute&&N.removeAttribute){N.setAttribute(L,"");M=typeof N[L]=="function";if(typeof N[L]!="undefined"){N[L]=void 0}N.removeAttribute(L)}}N=null;return M}return J})();var C=(function(){function J(M,K){if(document.defaultView&&document.defaultView.getComputedStyle){s=document.defaultView.getComputedStyle(M,"");r=[];if(s.length){for(var L=0;L<s.length;L++){try{v=s.getPropertyValue(s[L]);if(v!=""){r.push(s[L]+": "+v)}}catch(N){}}}else{for(var L in s){try{v=s.getPropertyValue(L);if(v!=""){r.push(L+": "+v)}}catch(N){}}}return r.join("; ")+";"}else{return null}}return J})();function B(J){this.initialize(J)}B.prototype={initialize:function(L){this.section=L.getSection({id:"parsing"});this.section.setItem({id:"doctype",passed:document.compatMode=="CSS1Compat",value:1});var J=true;var N=document.createElement("div");N.innerHTML="<div<div>";J&=N.firstChild&&N.firstChild.nodeName=="DIV<DIV";N.innerHTML="<div foo<bar=''>";J&=N.firstChild.attributes[0].nodeName=="foo<bar";N.innerHTML="<div foo=`bar`>";J&=N.firstChild.getAttribute("foo")=="`bar`";N.innerHTML="<div \"foo=''>";J&=N.firstChild&&N.firstChild.attributes[0].nodeName=='"foo';N.innerHTML="<a href='\nbar'></a>";J&=N.firstChild&&N.firstChild.getAttribute("href")=="\nbar";N.innerHTML="<!DOCTYPE html>";J&=N.firstChild==null;N.innerHTML="\u000D";J&=N.firstChild&&N.firstChild.nodeValue=="\u000A";N.innerHTML="⟨⟩";J&=N.firstChild.nodeValue=="\u27E8\u27E9";N.innerHTML="'";J&=N.firstChild.nodeValue=="'";N.innerHTML="ⅈ";J&=N.firstChild.nodeValue=="\u2148";N.innerHTML="𝕂";J&=N.firstChild.nodeValue=="\uD835\uDD42";N.innerHTML="∉";J&=N.firstChild.nodeValue=="\u2209";N.innerHTML='<?import namespace="foo" implementation="#bar">';J&=N.firstChild&&N.firstChild.nodeType==8&&N.firstChild.nodeValue=='?import namespace="foo" implementation="#bar"';N.innerHTML="<!--foo--bar-->";J&=N.firstChild&&N.firstChild.nodeType==8&&N.firstChild.nodeValue=="foo--bar";N.innerHTML="<![CDATA[x]]>";J&=N.firstChild&&N.firstChild.nodeType==8&&N.firstChild.nodeValue=="[CDATA[x]]";N.innerHTML="<textarea><!--</textarea>--></textarea>";J&=N.firstChild&&N.firstChild.firstChild&&N.firstChild.firstChild.nodeValue=="<!--";N.innerHTML="<textarea><!--</textarea>-->";J&=N.firstChild&&N.firstChild.firstChild&&N.firstChild.firstChild.nodeValue=="<!--";N.innerHTML="<style><!--</style>--></style>";J&=N.firstChild&&N.firstChild.firstChild&&N.firstChild.firstChild.nodeValue=="<!--";N.innerHTML="<style><!--</style>-->";J&=N.firstChild&&N.firstChild.firstChild&&N.firstChild.firstChild.nodeValue=="<!--";this.section.setItem({id:"tokenizer",passed:J,value:5});var J=true;var N=document.createElement("div");try{var M=document.createElement("html");M.innerHTML="";J&=M.firstChild&&M.firstChild.nodeName=="HEAD"&&M.lastChild.nodeName=="BODY"&&M.firstChild.nextSibling==M.lastChild}catch(N){J=false}try{var K=document.createElement("table");K.innerHTML="<col>";J&=K.firstChild&&K.firstChild.nodeName=="COLGROUP"}catch(N){J=false}N.innerHTML="<ul><li>A </li> <li>B</li></ul>";J&=N.firstChild&&N.firstChild.firstChild&&N.firstChild.firstChild.firstChild&&N.firstChild.firstChild.firstChild.nodeValue=="A ";N.innerHTML="<table><form><input type=hidden><input></form><div></div></table>";J&=N.firstChild&&N.firstChild.nodeName=="INPUT"&&N.firstChild.nextSibling&&N.firstChild.nextSibling.nodeName=="DIV"&&N.lastChild.nodeName=="TABLE"&&N.firstChild.nextSibling.nextSibling==N.lastChild&&N.lastChild.firstChild&&N.lastChild.firstChild.nodeName=="FORM"&&N.lastChild.firstChild.firstChild==null&&N.lastChild.lastChild.nodeName=="INPUT"&&N.lastChild.firstChild.nextSibling==N.lastChild.lastChild;N.innerHTML="<i>A<b>B<p></i>C</b>D";J&=N.firstChild&&N.childNodes.length==3&&N.childNodes[0].nodeName=="I"&&N.childNodes[0].childNodes.length==2&&N.childNodes[0].childNodes[0].nodeValue=="A"&&N.childNodes[0].childNodes[1].nodeName=="B"&&N.childNodes[0].childNodes[1].childNodes.length==1&&N.childNodes[0].childNodes[1].childNodes[0].nodeValue=="B"&&N.childNodes[1].nodeName=="B"&&N.childNodes[1].firstChild==null&&N.childNodes[2].nodeName=="P"&&N.childNodes[2].childNodes.length==2&&N.childNodes[2].childNodes[0].nodeName=="B"&&N.childNodes[2].childNodes[0].childNodes.length==2&&N.childNodes[2].childNodes[0].childNodes[0].nodeName=="I"&&N.childNodes[2].childNodes[0].childNodes[0].firstChild==null&&N.childNodes[2].childNodes[0].childNodes[1].nodeValue=="C"&&N.childNodes[2].childNodes[1].nodeValue=="D";N.innerHTML="<div></div>";J&=N.firstChild&&"namespaceURI" in N.firstChild&&N.firstChild.namespaceURI=="http://www.w3.org/1999/xhtml";this.section.setItem({id:"tree",passed:J,value:5});var N=document.createElement("div");N.innerHTML="<svg></svg>";var O=N.firstChild&&"namespaceURI" in N.firstChild&&N.firstChild.namespaceURI=="http://www.w3.org/2000/svg";this.section.setItem({id:"svg",passed:O,bonus:O?1:0});var N=document.createElement("div");N.innerHTML="<math></math>";var O=N.firstChild&&"namespaceURI" in N.firstChild&&N.firstChild.namespaceURI=="http://www.w3.org/1998/Math/MathML";this.section.setItem({id:"mathml",passed:O,bonus:O?1:0})}};function w(J){this.initialize(J)}w.prototype={initialize:function(J){this.section=J.getSection({id:"canvas"});this.canvas=document.createElement("canvas");this.section.setItem({id:"element",passed:!!this.canvas.getContext,value:5});this.section.setItem({id:"context",passed:this.canvas.getContext&&typeof CanvasRenderingContext2D!="undefined"&&this.canvas.getContext("2d") instanceof CanvasRenderingContext2D,value:10});this.section.setItem({id:"text",passed:this.canvas.getContext&&typeof this.canvas.getContext("2d").fillText=="function",value:5})}};function u(J){this.initialize(J)}u.prototype={initialize:function(J){this.section=J.getSection({id:"video"});this.element=document.createElement("video");this.section.setItem({id:"element",passed:!!this.element.canPlayType,value:20});this.section.setItem({id:"subtitle",passed:"track" in document.createElement("track"),value:10});this.section.setItem({id:"poster",passed:"poster" in this.element,value:1});var K={id:"mpeg4",passed:!!this.element.canPlayType&&this.canPlayType('video/mp4; codecs="mp4v.20.8"')};if(K.passed){K.bonus=2}this.section.setItem(K);var K={id:"h264",passed:!!this.element.canPlayType&&(this.canPlayType('video/mp4; codecs="avc1.42E01E"')||this.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'))};if(K.passed){K.bonus=2}this.section.setItem(K);var K={id:"theora",passed:!!this.element.canPlayType&&this.canPlayType('video/ogg; codecs="theora"')};if(K.passed){K.bonus=2}this.section.setItem(K);var K={id:"webm",passed:!!this.element.canPlayType&&this.canPlayType('video/webm; codecs="vp8"')};if(K.passed){K.bonus=2}this.section.setItem(K)},canPlayType:function(J){if(Browsers.iOS&&Browsers.iOS<4.2){return this.element.canPlayType(J)=="probably"||this.element.canPlayType(J)=="maybe"}else{return this.element.canPlayType(J)=="probably"}}};function D(J){this.initialize(J)}D.prototype={initialize:function(K){this.section=K.getSection({id:"audio"});this.element=document.createElement("audio");this.section.setItem({id:"element",passed:!!this.element.canPlayType,value:20});var M={id:"pcm",passed:!!this.element.canPlayType&&this.canPlayType('audio/wav; codecs="1"')};if(M.passed){M.bonus=1}this.section.setItem(M);var L=false;if(this.element.canPlayType){var J=this.element.canPlayType("audio/mpeg");if(J=="maybe"){L=true}else{if(J=="probably"){L=true}}}var M={id:"mp3",passed:L};if(M.passed){M.bonus=1}this.section.setItem(M);var M={id:"aac",passed:!!this.element.canPlayType&&this.canPlayType('audio/mp4; codecs="mp4a.40.2"')};if(M.passed){M.bonus=1}this.section.setItem(M);var M={id:"vorbis",passed:!!this.element.canPlayType&&this.canPlayType('audio/ogg; codecs="vorbis"')};if(M.passed){M.bonus=1}this.section.setItem(M);var M={id:"webm",passed:!!this.element.canPlayType&&this.canPlayType('audio/webm; codecs="vorbis"')};if(M.passed){M.bonus=1}this.section.setItem(M)},canPlayType:function(J){if(Browsers.iOS&&Browsers.iOS<4.2){return this.element.canPlayType(J)=="probably"||this.element.canPlayType(J)=="maybe"}else{return this.element.canPlayType(J)=="probably"}}};function h(J){this.initialize(J)}h.prototype={initialize:function(J){this.section=J.getSection({id:"device"});this.section.setItem({id:"getUserMedia",passed:!!navigator.getUserMedia||!!navigator.webkitGetUserMedia||!!navigator.mozGetUserMedia||!!navigator.msGetUserMedia||!!navigator.oGetUserMedia,value:20})}};function j(J){this.initialize(J)}j.prototype={initialize:function(O){this.section=O.getSection({id:"elements"});var P=document.createElement("div");P.setAttribute("data-test","test");this.section.setItem({id:"dataset",passed:"dataset" in P,value:4});var V=this.section.getGroup({id:"section"});var J="section nav article aside hgroup header footer".split(" ");for(var T in J){var P=document.createElement(J[T]);document.body.appendChild(P);V.setItem({id:J[T],passed:typeof HTMLElement!="undefined"&&P instanceof HTMLElement&&this.isBlock(P)&&this.closesImplicitly(J[T]),value:1});document.body.removeChild(P)}var V=this.section.getGroup({id:"grouping"});var J="figure figcaption".split(" ");for(var T in J){var P=document.createElement(J[T]);document.body.appendChild(P);V.setItem({id:J[T],passed:typeof HTMLElement!="undefined"&&P instanceof HTMLElement&&this.isBlock(P)&&(J[T]!="figure"||this.closesImplicitly(J[T])),value:1});document.body.removeChild(P)}var P=document.createElement("ol");V.setItem({id:"ol",passed:"reversed" in P,value:1});var V=this.section.getGroup({id:"semantic"});var P=document.createElement("mark");document.body.appendChild(P);V.setItem({id:"mark",passed:typeof HTMLElement!="undefined"&&P instanceof HTMLElement&&(color=this.getStyle(P,"background-color"))&&(color=="yellow"||color=="rgb(255, 255, 0)"||color=="#ffff00"),value:1});document.body.removeChild(P);var M=document.createElement("div");document.body.appendChild(M);M.innerHTML="<ruby id='ruby'><rp id='rp'></rp><rt id='rt'></rt></ruby>";var W=document.getElementById("ruby");var R=document.getElementById("rt");var L=document.getElementById("rp");var N=W&&typeof HTMLElement!="undefined"&&W instanceof HTMLElement;var Z=R&&typeof HTMLElement!="undefined"&&R instanceof HTMLElement;var Q=L&&typeof HTMLElement!="undefined"&&L instanceof HTMLElement&&this.isHidden(L);document.body.removeChild(M);V.setItem({id:"ruby",passed:N&&Z&&Q,value:3});var P=document.createElement("time");V.setItem({id:"time",passed:typeof HTMLTimeElement!="undefined"&&P instanceof HTMLTimeElement,value:1});var P=document.createElement("wbr");V.setItem({id:"wbr",passed:typeof HTMLElement!="undefined"&&P instanceof HTMLElement,value:1});var V=this.section.getGroup({id:"interactive"});var P=document.createElement("details");P.innerHTML="<summary>a</summary>b";document.body.appendChild(P);var Y=P.offsetHeight;P.open=true;var K=Y!=P.offsetHeight;V.setItem({id:"details",passed:K,value:1});document.body.removeChild(P);var P=document.createElement("summary");document.body.appendChild(P);V.setItem({id:"summary",passed:typeof HTMLElement!="undefined"&&P instanceof HTMLElement,value:1});document.body.removeChild(P);var P=document.createElement("command");document.body.appendChild(P);V.setItem({id:"command",passed:typeof HTMLCommandElement!="undefined"&&P instanceof HTMLCommandElement,value:2});document.body.removeChild(P);var P=document.createElement("menu");document.body.appendChild(P);V.setItem({id:"menu",passed:typeof HTMLMenuElement!="undefined"&&P instanceof HTMLMenuElement,value:1});var U="type" in P;var S=C(P);var K=U;try{P.type="toolbar"}catch(T){K=false}var X=C(P);V.setItem({id:"menutoolbar",passed:typeof HTMLMenuElement!="undefined"&&P instanceof HTMLMenuElement&&K&&S!=X,value:1});var K=U;try{P.type="context"}catch(T){K=false}var X=C(P);V.setItem({id:"menucontext",passed:typeof HTMLMenuElement!="undefined"&&P instanceof HTMLMenuElement&&K&&S!=X,value:1});document.body.removeChild(P);var P=document.createElement("div");this.section.setItem({id:"hidden",passed:"hidden" in P,value:1});var V=this.section.getGroup({id:"dynamic"});var P=document.createElement("div");V.setItem({id:"outerHTML",passed:!!("outerHTML" in P),value:1});V.setItem({id:"insertAdjacentHTML",passed:!!("insertAdjacentHTML" in P),value:1})},getStyle:function(L,J){function K(M){return M.replace(/-\D/g,function(N){return N.charAt(1).toUpperCase()})}if(L.style[J]){return L.style[J]}else{if(L.currentStyle){return L.currentStyle[K(J)]}else{if(document.defaultView&&document.defaultView.getComputedStyle){s=document.defaultView.getComputedStyle(L,"");return s&&s.getPropertyValue(J)}else{return null}}}},isBlock:function(J){return this.getStyle(J,"display")=="block"},closesImplicitly:function(J){var K=document.createElement("div");K.innerHTML="<p><"+J+"></"+J+">";return K.childNodes.length==2},isHidden:function(J){return this.getStyle(J,"display")=="none"}};function p(J){this.initialize(J)}p.prototype={initialize:function(ab){this.section=ab.getSection({id:"form"});var L=this.createInput("text");var Y={field:C(L.field),wrapper:C(L.wrapper)};this.removeInput(L);var R=this.section.getGroup({id:"text"});var L=this.createInput("text");R.setItem({id:"element",passed:L.field.type=="text"});R.setItem({id:"selection",passed:"selectionDirection" in L.field,value:2});this.removeInput(L);var R=this.section.getGroup({id:"search"});var L=this.createInput("search");R.setItem({id:"element",passed:L.field.type=="search",value:2});this.removeInput(L);var R=this.section.getGroup({id:"tel"});var L=this.createInput("tel");R.setItem({id:"element",passed:L.field.type=="tel",value:2});this.removeInput(L);var R=this.section.getGroup({id:"url"});var L=this.createInput("url");var W=false;if("validity" in L.field){W=true;L.field.value="foo";W&=!L.field.validity.valid;L.field.value="http://foo.org";W&=L.field.validity.valid}R.setItem({id:"element",passed:L.field.type=="url",value:2,required:true});R.setItem({id:"validation",passed:W,required:true});this.removeInput(L);var R=this.section.getGroup({id:"email"});var L=this.createInput("email");var W=false;if("validity" in L.field){W=true;L.field.value="foo";W&=!L.field.validity.valid;L.field.value="foo@bar.org";W&=L.field.validity.valid}R.setItem({id:"element",passed:L.field.type=="email",value:2,required:true});R.setItem({id:"validation",passed:W,required:true});this.removeInput(L);var V=["datetime","date","month","week","time","datetime-local"];for(var X in V){var R=this.section.getGroup({id:V[X]});var L=this.createInput(V[X]);L.field.value="foobar";var ae=L.field.value=="";var ag=L.field.type==V[X];R.setItem({id:"element",passed:ag,value:2,required:true});R.setItem({id:"ui",passed:ag&&Y.field!=C(L.field)||Y.wrapper!=C(L.wrapper),value:2});R.setItem({id:"sanitization",passed:ag&&ae,required:true});R.setItem({id:"min",passed:ag&&"min" in L.field,required:true});R.setItem({id:"max",passed:ag&&"max" in L.field,required:true});R.setItem({id:"step",passed:ag&&"step" in L.field,required:true});R.setItem({id:"stepDown",passed:ag&&"stepDown" in L.field,required:true});R.setItem({id:"stepUp",passed:ag&&"stepUp" in L.field,required:true});this.removeInput(L)}var V=["number","range"];for(var X in V){var R=this.section.getGroup({id:V[X],name:"<code>input type="+V[X]+"</code>"});var L=this.createInput(V[X]);L.field.value="foobar";var ae=L.field.value!="foobar";var W=false;if("validity" in L.field){W=true;L.field.min=40;L.field.max=50;L.field.value=100;W&=!L.field.validity.valid;L.field.value=42;W&=L.field.validity.valid}var ag=L.field.type==V[X];R.setItem({id:"element",passed:ag,value:2,required:true});R.setItem({id:"ui",passed:ag&&Y.field!=C(L.field)||Y.wrapper!=C(L.wrapper),value:2});R.setItem({id:"sanitization",passed:ag&&ae,required:true});if(V[X]!="range"){R.setItem({id:"validation",passed:ag&&W,required:true})}R.setItem({id:"min",passed:ag&&"min" in L.field,required:true});R.setItem({id:"max",passed:ag&&"max" in L.field,required:true});R.setItem({id:"step",passed:ag&&"step" in L.field,required:true});R.setItem({id:"stepDown",passed:ag&&"stepDown" in L.field,required:true});R.setItem({id:"stepUp",passed:ag&&"stepUp" in L.field,required:true});this.removeInput(L)}var R=this.section.getGroup({id:"color"});var L=this.createInput("color");L.field.value="foobar";var ae=L.field.value!="foobar";var W=false;if("validity" in L.field){W=true;L.field.value="foo";W&=!L.field.validity.valid;L.field.value="#000000";W&=L.field.validity.valid}R.setItem({id:"element",passed:L.field.type=="color",value:2});R.setItem({id:"ui",passed:Y.field!=C(L.field)||Y.wrapper!=C(L.wrapper),value:2});R.setItem({id:"sanitization",passed:ae,required:true});R.setItem({id:"validation",passed:W,required:true});this.removeInput(L);var R=this.section.getGroup({id:"checkbox"});var L=this.createInput("checkbox");R.setItem({id:"element",passed:L.field.type=="checkbox",value:0});R.setItem({id:"indeterminate",passed:"indeterminate" in L.field,value:1});this.removeInput(L);var R=this.section.getGroup({id:"image"});var L=this.createInput("image");var aa="width" in L.field;var T="height" in L.field;L.field.setAttribute("width","100");L.field.setAttribute("height","100");R.setItem({id:"element",passed:L.field.type=="image",value:0});R.setItem({id:"width",passed:aa&&L.field.offsetWidth==100,value:1});R.setItem({id:"height",passed:T&&L.field.offsetHeight==100,value:1});this.removeInput(L);var R=this.section.getGroup({id:"file"});var L=this.createInput("file");R.setItem({id:"element",passed:L.field.type=="file",value:0});R.setItem({id:"files",passed:L.field.files&&L.field.files instanceof FileList,value:1});this.removeInput(L);var R=this.section.getGroup({id:"textarea"});var L=document.createElement("textarea");R.setItem({id:"element",passed:typeof HTMLTextAreaElement!="undefined"&&L instanceof HTMLTextAreaElement,value:0});R.setItem({id:"maxlength",passed:"maxLength" in L,value:1});R.setItem({id:"wrap",passed:"wrap" in L,value:1});var R=this.section.getGroup({id:"select"});var L=document.createElement("select");R.setItem({id:"element",passed:typeof HTMLSelectElement!="undefined"&&L instanceof HTMLSelectElement,value:0});R.setItem({id:"required",passed:"required" in L,value:1});var R=this.section.getGroup({id:"fieldset"});var L=document.createElement("fieldset");R.setItem({id:"element",passed:typeof HTMLFieldSetElement!="undefined"&&L instanceof HTMLFieldSetElement,value:0});R.setItem({id:"elements",passed:"elements" in L,value:1});R.setItem({id:"disabled",passed:"disabled" in L,value:1});var R=this.section.getGroup({id:"datalist"});var L=document.createElement("datalist");R.setItem({id:"element",passed:(typeof HTMLDataListElement!="undefined"&&L instanceof HTMLDataListElement)||L.childNodes.length,value:2,required:true});var L=document.createElement("input");R.setItem({id:"list",passed:!!("list" in L),required:true});var R=this.section.getGroup({id:"keygen"});var L=document.createElement("div");L.innerHTML="<keygen>";R.setItem({id:"element",passed:typeof HTMLKeygenElement!="undefined"&&L.firstChild instanceof HTMLKeygenElement&&"challenge" in L.firstChild&&"keytype" in L.firstChild,value:2,required:true});R.setItem({id:"challenge",passed:L.firstChild&&"challenge" in L.firstChild,required:true});R.setItem({id:"keytype",passed:L.firstChild&&"keytype" in L.firstChild,required:true});var R=this.section.getGroup({id:"output"});var L=document.createElement("output");R.setItem({id:"element",passed:typeof HTMLOutputElement!="undefined"&&L instanceof HTMLOutputElement,value:2});var R=this.section.getGroup({id:"progress"});var L=document.createElement("progress");R.setItem({id:"element",passed:typeof HTMLProgressElement!="undefined"&&L instanceof HTMLProgressElement,value:2});var R=this.section.getGroup({id:"meter"});var L=document.createElement("meter");R.setItem({id:"element",passed:typeof HTMLMeterElement!="undefined"&&L instanceof HTMLMeterElement,value:2});var R=this.section.getGroup({id:"validation"});var L=document.createElement("input");var N="pattern required".split(" ");for(var Z in N){R.setItem({id:N[Z],passed:!!(N[Z] in L),value:1})}var R=this.section.getGroup({id:"association"});var K=document.createElement("input");K.id="a";document.body.appendChild(K);var S=document.createElement("label");S.setAttribute("for","a");document.body.appendChild(S);R.setItem({id:"control",passed:S.control==K,value:1});document.body.removeChild(K);document.body.removeChild(S);var L=document.createElement("div");document.body.appendChild(L);L.innerHTML='<form id="form"></form><input form="form">';R.setItem({id:"form",passed:L.lastChild.form==L.firstChild,value:1});document.body.removeChild(L);var N="formAction formEnctype formMethod formNoValidate formTarget".split(" ");var L=document.createElement("input");for(var Z in N){R.setItem({id:N[Z],passed:!!(N[Z] in L),value:1})}var L=document.createElement("input");document.body.appendChild(L);L.id="testFormInput";var S=document.createElement("label");S.setAttribute("for","testFormInput");document.body.appendChild(S);R.setItem({id:"labels",passed:(!!L.labels&&L.labels.length==1&&L.labels[0]==S),value:1});document.body.removeChild(S);document.body.removeChild(L);var R=this.section.getGroup({id:"other"});var L=document.createElement("input");R.setItem({id:"autofocus",passed:!!("autofocus" in L),value:1});var N="autocomplete placeholder multiple dirName".split(" ");for(var Z in N){var M=N[Z].toLowerCase();R.setItem({id:M,passed:!!(N[Z] in L),value:1})}var O="valid invalid optional required in-range out-of-range read-write read-only".split(" ");var ai=[false,false,false,false,false,false,false,false];var ah=false;if(!!document.querySelector){var L=document.createElement("input");L.id="testFormInput";L.setAttribute("type","text");document.body.appendChild(L);if("querySelector" in document){try{ai[0]=!!document.querySelector("#testFormInput:valid")}catch(af){ai[0]=false}try{ai[6]=!!document.querySelector("#testFormInput:read-write")}catch(af){ai[6]=false}if("validity" in L&&"setCustomValidity" in L){L.setCustomValidity("foo");try{ai[1]=!!document.querySelector("#testFormInput:invalid")}catch(af){ai[1]=false}}else{ai[1]=false}try{ai[2]=!!document.querySelector("#testFormInput:optional")}catch(af){ai[2]=false}L.setAttribute("required","true");try{ai[3]=!!document.querySelector("#testFormInput:required")}catch(af){ai[3]=false}L.setAttribute("type","number");L.setAttribute("min","10");L.setAttribute("max","20");L.setAttribute("value","15");try{ai[4]=!!document.querySelector("#testFormInput:in-range")}catch(af){ai[4]=false}L.setAttribute("value","25");try{ai[5]=!!document.querySelector("#testFormInput:out-of-range")}catch(af){ai[5]=false}L.setAttribute("readonly","readonly");try{ai[7]=!!document.querySelector("#testFormInput:read-only")}catch(af){ai[7]=false}}else{ah=true}document.body.removeChild(L)}var R=this.section.getGroup({id:"selectors"});for(var ad=0;ad<O.length;ad++){R.setItem({id:O[ad],passed:ai[ad],value:2,custom:ah?"unknown":false})}var R=this.section.getGroup({id:"events"});var P=R.setItem({id:"oninput",passed:x("input"),value:1});var Q=R.setItem({id:"onchange",passed:x("change"),value:1});var J=R.setItem({id:"oninvalid",passed:x("invalid"),value:1});try{P.startBackground();Q.startBackground();var ac=document.createEvent("KeyboardEvent");if(ac.initKeyEvent){ac.initKeyEvent("keypress",false,true,null,false,false,false,false,null,65);var U=document.createElement("input");U.style.position="fixed";U.style.left="-500px";U.style.top="0px";document.body.appendChild(U);U.addEventListener("input",function(){P.update({passed:true});P.stopBackground()},true);U.addEventListener("change",function(){Q.update({passed:true});Q.stopBackground()},true);U.focus();U.dispatchEvent(ac);U.blur();window.setTimeout(function(){document.body.removeChild(U);P.stopBackground();Q.stopBackground()},1000)}else{P.stopBackground();Q.stopBackground()}}catch(af){P.stopBackground();Q.stopBackground()}var R=this.section.getGroup({id:"validation"});var L=document.createElement("form");R.setItem({id:"checkValidity",passed:"checkValidity" in L,value:8});R.setItem({id:"noValidate",passed:"noValidate" in L,value:1})},createInput:function(J){var M=document.createElement("div");document.body.appendChild(M);var L=document.createElement("input");M.appendChild(L);try{L.setAttribute("type",J)}catch(K){}M.style.position="absolute";M.style.display="inline-block";M.style.top="0px";M.style.left="0px";return{field:L,wrapper:M}},removeInput:function(J){document.body.removeChild(J.wrapper)}};function z(J){this.initialize(J)}z.prototype={initialize:function(M){this.section=M.getSection({id:"interaction"});var L=document.createElement("div");var N=Browsers.Opera;var K=!Browsers.desktop&&!N;var O=this.section.getGroup({id:"attributes"});O.setItem({id:"draggable",passed:"draggable" in L&&!K,value:10});O.setItem({id:"dropzone",passed:("dropzone" in L||"webkitdropzone" in L||"mozdropzone" in L||"msdropzone" in L||"odropzone" in L)&&!K,value:2});var O=this.section.getGroup({id:"events"});var J="draggable" in L&&!K;O.setItem({id:"ondrag",passed:x("drag")&&J,value:1});O.setItem({id:"ondragstart",passed:x("dragstart")&&J,value:1});O.setItem({id:"ondragenter",passed:x("dragenter")&&J,value:1});O.setItem({id:"ondragover",passed:x("dragover")&&J,value:1});O.setItem({id:"ondragleave",passed:x("dragleave")&&J,value:1});O.setItem({id:"ondragend",passed:x("dragend")&&J,value:1});O.setItem({id:"ondrop",passed:x("drop")&&J,value:1});var L=document.createElement("div");var N=Browsers.iOS>=5||Browsers.Android>=4||Browsers.WindowsPhone>=7.5||Browsers.BlackBerry||Browsers.Firefox||Browsers.Opera||Browsers.Chrome||Browsers.Meego;var K=!Browsers.desktop&&!N;var O=this.section.getGroup({id:"editingElements"});O.setItem({id:"contentEditable",passed:"contentEditable" in L&&!K,value:8});O.setItem({id:"isContentEditable",passed:"isContentEditable" in L&&!K,value:1});var O=this.section.getGroup({id:"editingDocuments"});O.setItem({id:"designMode",passed:"designMode" in document&&!K,value:2});var O=this.section.getGroup({id:"apis"});O.setItem({id:"execCommand",passed:"execCommand" in document&&!K,value:1});O.setItem({id:"queryCommandEnabled",passed:"queryCommandEnabled" in document&&!K,value:1});O.setItem({id:"queryCommandIndeterm",passed:"queryCommandIndeterm" in document&&!K,value:1});O.setItem({id:"queryCommandState",passed:"queryCommandState" in document&&!K,value:1});O.setItem({id:"queryCommandSupported",passed:"queryCommandSupported" in document&&!K,value:1});O.setItem({id:"queryCommandValue",passed:"queryCommandValue" in document&&!K,value:1});this.section.setItem({id:"spellcheck",passed:!!("spellcheck" in L),value:1})}};function G(J){this.initialize(J)}G.prototype={initialize:function(J){this.section=J.getSection({id:"history"});this.section.setItem({id:"history",passed:!!(window.history&&history.pushState),value:5})}};function t(J){this.initialize(J)}t.prototype={initialize:function(L){this.section=L.getSection({id:"microdata"});var J=document.createElement("div");J.innerHTML='<div id="microdataItem" itemscope itemtype="http://example.net/user"><p>My name is <span id="microdataProperty" itemprop="name">Elizabeth</span>.</p></div>';document.body.appendChild(J);var N=document.getElementById("microdataItem");var O=document.getElementById("microdataProperty");var M=true;M=M&&!!("itemValue" in O)&&O.itemValue=="Elizabeth";M=M&&!!("properties" in N)&&N.properties.name[0].itemValue=="Elizabeth";if(!!document.getItems){var K=document.getItems("http://example.net/user")[0];M=M&&K.properties.name[0].itemValue=="Elizabeth"}document.body.removeChild(J);this.section.setItem({id:"microdata",passed:M,value:15})}};function b(J){this.initialize(J)}b.prototype={initialize:function(J){this.section=J.getSection({id:"offline"});this.section.setItem({id:"applicationCache",passed:!!window.applicationCache,value:15});this.section.setItem({id:"registerProtocolHandler",passed:!!window.navigator.registerProtocolHandler,value:2});this.section.setItem({id:"registerContentHandler",passed:!!window.navigator.registerContentHandler,value:2});this.section.setItem({id:"addSearchProvider",passed:window.external&&typeof window.external.AddSearchProvider!="undefined"&&typeof window.external.IsSearchProviderInstalled!="undefined",value:1})}};function n(J){this.initialize(J)}n.prototype={initialize:function(J){this.section=J.getSection({id:"security"});this.section.setItem({id:"sandbox",passed:"sandbox" in document.createElement("iframe"),value:5});this.section.setItem({id:"seamless",passed:"seamless" in document.createElement("iframe"),value:5});this.section.setItem({id:"srcdoc",passed:"srcdoc" in document.createElement("iframe"),value:5})}};function l(J){this.initialize(J)}l.prototype={initialize:function(J){this.section=J.getSection({id:"various"});this.section.setItem({id:"scoped",passed:"scoped" in document.createElement("style"),value:2});this.section.setItem({id:"async",passed:"async" in document.createElement("script"),value:2});this.section.setItem({id:"onerror",passed:x("error"),value:1});this.section.setItem({id:"base64",passed:"btoa" in window&&"atob" in window,value:1})}};function q(J){this.initialize(J)}q.prototype={initialize:function(J){this.section=J.getSection({id:"location"});this.section.setItem({id:"geolocation",passed:!!navigator.geolocation,value:15});this.section.setItem({id:"orientation",passed:!!window.DeviceOrientationEvent,value:5})}};function d(J){this.initialize(J)}d.prototype={initialize:function(M){this.section=M.getSection({id:"webgl"});var L=document.createElement("canvas");var Q=["webgl","ms-webgl","experimental-webgl","moz-webgl","opera-3d","webkit-3d","ms-3d","3d"];var N=false;for(var K=-1,J=Q.length;++K<J;){try{if(L.getContext(Q[K])){N=true;break}}catch(P){}}this.section.setItem({id:"context",passed:N,value:15});var O=this.section.getGroup({id:"datatypes"});O.setItem({id:"ArrayBuffer",passed:typeof ArrayBuffer!="undefined",value:1});O.setItem({id:"Int8Array",passed:typeof Int8Array!="undefined",value:1});O.setItem({id:"Uint8Array",passed:typeof Uint8Array!="undefined",value:1});O.setItem({id:"Int16Array",passed:typeof Int16Array!="undefined",value:1});O.setItem({id:"Uint16Array",passed:typeof Uint16Array!="undefined",value:1});O.setItem({id:"Int32Array",passed:typeof Int32Array!="undefined",value:1});O.setItem({id:"Uint32Array",passed:typeof Uint32Array!="undefined",value:1});O.setItem({id:"Float32Array",passed:typeof Float32Array!="undefined",value:1});O.setItem({id:"Float64Array",passed:typeof Float64Array!="undefined",value:1});O.setItem({id:"DataView",passed:typeof DataView!="undefined",value:1})}};function c(J){this.initialize(J)}c.prototype={initialize:function(J){this.section=J.getSection({id:"communication"});this.section.setItem({id:"postMessage",passed:!!window.postMessage,value:5});this.section.setItem({id:"eventSource",passed:"EventSource" in window,value:10});var L=this.section.getGroup({id:"xmlhttprequest2"});L.setItem({id:"upload",passed:window.XMLHttpRequest&&"upload" in new XMLHttpRequest(),value:5});var K=L.setItem({id:"textresponse",passed:false,value:1});this.testResponseTypeText(K);var K=L.setItem({id:"documentresponse",passed:false,value:2});this.testResponseTypeDocument(K);var K=L.setItem({id:"arrayresponse",passed:false,value:2});this.testResponseTypeArrayBuffer(K);var K=L.setItem({id:"blobresponse",passed:false,value:2});this.testResponseTypeBlob(K);this.section.setItem({id:"webSocket",passed:"WebSocket" in window||"MozWebSocket" in window,value:10})},testResponseTypeDocument:function(K){if(!window.XMLHttpRequest){return}var M=new window.XMLHttpRequest();if(typeof M.responseType=="undefined"){return}var J=false;M.onreadystatechange=function(){if(this.readyState==4&&!J){J=true;passed=false;try{passed=!!(this.responseXML&&this.responseXML.title&&this.responseXML.title=="&&<")}catch(N){}K.stopBackground();K.update({passed:passed})}};try{K.startBackground();M.open("GET","detect.html");M.responseType="document";M.send()}catch(L){K.stopBackground()}},testResponseTypeText:function(K){if(!window.XMLHttpRequest){return}var M=new window.XMLHttpRequest();if(typeof M.responseType=="undefined"){return}var J=false;M.onreadystatechange=function(){if(this.readyState==4&&!J){J=true;passed=false;try{passed=!!(this.responseText)}catch(N){}K.stopBackground();K.update({passed:passed})}};try{K.startBackground();M.open("GET","detect.html");M.responseType="text";M.send()}catch(L){K.stopBackground()}},testResponseTypeBlob:function(K){if(!window.XMLHttpRequest||!window.Blob){return}var M=new window.XMLHttpRequest();if(typeof M.responseType=="undefined"){return}var J=false;M.onreadystatechange=function(){if(this.readyState==4&&!J){J=true;passed=false;try{passed=!!(this.response&&this.response instanceof Blob)}catch(N){}K.stopBackground();K.update({passed:passed})}};try{K.startBackground();M.open("GET","detect.html");M.responseType="blob";M.send()}catch(L){K.stopBackground()}},testResponseTypeArrayBuffer:function(K){if(!window.XMLHttpRequest||!window.ArrayBuffer){return}var M=new window.XMLHttpRequest();if(typeof M.responseType=="undefined"){return}var J=false;M.onreadystatechange=function(){if(this.readyState==4&&!J){J=true;passed=false;try{passed=!!(this.response&&this.response instanceof ArrayBuffer)}catch(N){}K.stopBackground();K.update({passed:passed})}};try{K.startBackground();M.open("GET","detect.html");M.responseType="arraybuffer";M.send()}catch(L){K.stopBackground()}}};function f(J){this.initialize(J)}f.prototype={initialize:function(J){this.section=J.getSection({id:"files"});this.section.setItem({id:"fileReader",passed:"FileReader" in window,value:10});this.section.setItem({id:"fileSystem",passed:!!window.requestFileSystem||!!window.webkitRequestFileSystem||!!window.mozRequestFileSystem||!!window.oRequestFileSystem||!!window.msRequestFileSystem,value:10})}};function A(J){this.initialize(J)}A.prototype={initialize:function(J){this.section=J.getSection({id:"storage"});this.section.setItem({id:"sessionStorage",passed:"sessionStorage" in window&&window.sessionStorage!=null,value:5});var L=false;try{L="localStorage" in window&&window.localStorage!=null}catch(K){if(K.name=="NS_ERROR_DOM_SECURITY_ERR"){L=true}}this.section.setItem({id:"localStorage",passed:L,value:5});this.section.setItem({id:"indexedDB",passed:this.hasIndexedDB(),value:10});this.section.setItem({id:"sqlDatabase",passed:this.hasWebSQLDatabase(),value:0,award:!this.hasIndexedDB()?5:0})},hasWebSQLDatabase:function(){return !!window.openDatabase},hasIndexedDB:function(){return"indexedDB" in window||"webkitIndexedDB" in window||"mozIndexedDB" in window||"moz_indexedDB" in window||"oIndexedDB" in window||"msIndexedDB" in window}};function k(J){this.initialize(J)}k.prototype={initialize:function(J){this.section=J.getSection({id:"workers"});this.section.setItem({id:"worker",passed:!!window.Worker,value:10});this.section.setItem({id:"sharedWorker",passed:!!window.SharedWorker,value:5})}};function a(J){this.initialize(J)}a.prototype={initialize:function(J){this.section=J.getSection({id:"notifications"});this.section.setItem({id:"notifications",passed:this.hasNotification(),value:10})},hasNotification:function(){return"Notifications" in window||"webkitNotifications" in window||"mozNotifications" in window||"oNotifications" in window||"msNotifications" in window}};function e(J){this.initialize(J)}e.prototype={initialize:function(K){this.section=K.getSection({id:"other"});this.section.setItem({id:"pagevisiblity",passed:"visibilityState" in document||"webkitVisibilityState" in document||"mozVisibilityState" in document||"oVisibilityState" in document||"msVisibilityState" in document,value:2});this.section.setItem({id:"getSelection",passed:!!window.getSelection,value:4});var J=document.createElement("div");this.section.setItem({id:"scrollIntoView",passed:!!J.scrollIntoView,value:1})}};function E(J){this.initialize(J)}E.prototype={initialize:function(J){this.section=J.getSection({id:"webaudio"});this.section.setItem({id:"webaudio",passed:this.hasWebAudio(),value:4})},hasWebAudio:function(){return"AudioContext" in window||"webkitAudioContext" in window||"mozAudioContext" in window||"oAudioContext" in window||"msAudioContext" in window}};function I(J){this.initialize(J)}I.prototype={initialize:function(J){this.section=J.getSection({id:"animation"});this.section.setItem({id:"requestFullScreen",passed:!!document.documentElement.requestFullScreen||!!document.documentElement.webkitRequestFullScreen||!!document.documentElement.mozRequestFullScreen||!!document.documentElement.msRequestFullScreen||!!document.documentElement.oRequestFullScreen,value:2});this.section.setItem({id:"requestAnimationFrame",passed:!!window.requestAnimationFrame||!!window.webkitRequestAnimationFrame||!!window.mozRequestAnimationFrame||!!window.msRequestAnimationFrame||!!window.oRequestAnimationFrame,value:2})}};return F})();
new Test30(function(r) {
/* Submit results */
var payload = '{' +
'"version": "3",' +
'"revision": "1",' +
'"uniqueid": "' + r.uniqueid + '",' +
'"score": ' + r.score + ',' +
'"bonus": ' + r.bonus + ',' +
'"camouflage": "' + (Browsers.camouflage ? '1' : '0') + '",' +
'"browserName": "' + (Browsers.browser.name ? Browsers.browser.name : '') + '",' +
'"browserChannel": "' + (Browsers.browser.channel ? Browsers.browser.channel : '') + '",' +
'"browserVersion": "' + (Browsers.browser.version ? Browsers.browser.version.toString() : '') + '",' +
'"browserVersionType": "' + (Browsers.browser.version ? Browsers.browser.version.type : '') + '",' +
'"browserVersionMajor": "' + (Browsers.browser.version ? Browsers.browser.version.major : '') + '",' +
'"browserVersionMinor": "' + (Browsers.browser.version ? Browsers.browser.version.minor : '') + '",' +
'"browserVersionOriginal": "' + (Browsers.browser.version ? Browsers.browser.version.original : '') + '",' +
'"browserMode": "' + (Browsers.browser.mode ? Browsers.browser.mode : '') + '",' +
'"engineName": "' + (Browsers.engine.name ? Browsers.engine.name : '') + '",' +
'"engineVersion": "' + (Browsers.engine.version ? Browsers.engine.version.toString() : '') + '",' +
'"osName": "' + (Browsers.os.name ? Browsers.os.name : '') + '",' +
'"osVersion": "' + (Browsers.os.version ? Browsers.os.version.toString() : '') + '",' +
'"deviceManufacturer": "' + (Browsers.device.manufacturer ? Browsers.device.manufacturer : '') + '",' +
'"deviceModel": "' + (Browsers.device.model ? Browsers.device.model : '') + '",' +
'"deviceType": "' + (Browsers.device.type ? Browsers.device.type : '') + '",' +
'"deviceWidth": "' + (Browsers.device.type != 'desktop' ? screen.width : '') + '",' +
'"deviceHeight": "' + (Browsers.device.type != 'desktop' ? screen.height : '') + '",' +
'"useragent": "' + navigator.userAgent + '",' +
'"humanReadable": "' + Browsers.toString() + '",' +
'"points": "' + r.points + '",' +
'"results": "' + r.results + '"' +
'}';
submit('submit', payload);
function submit(method, payload) {
var httpRequest;
if (window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
} else if (window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
httpRequest.open('POST','/api/' + method, true);
httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
httpRequest.send('payload=' + encodeURIComponent(payload));
}
});
</script>
</body>