michael@0: /** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: var supportedProps = [ michael@0: "appCodeName", michael@0: "appName", michael@0: "appVersion", michael@0: "platform", michael@0: "product", michael@0: "taintEnabled", michael@0: "userAgent", michael@0: "onLine" michael@0: ]; michael@0: michael@0: for (var prop in navigator) { michael@0: // Make sure the list is current! michael@0: if (supportedProps.indexOf(prop) == -1) { michael@0: throw "Navigator has the '" + prop + "' property that isn't in the list!"; michael@0: } michael@0: } michael@0: michael@0: var obj; michael@0: michael@0: for (var index = 0; index < supportedProps.length; index++) { michael@0: var prop = supportedProps[index]; michael@0: michael@0: if (typeof navigator[prop] == "undefined") { michael@0: throw "Navigator has no '" + prop + "' property!"; michael@0: } michael@0: michael@0: obj = { michael@0: name: prop, michael@0: value: prop === "taintEnabled" ? navigator[prop]() : navigator[prop] michael@0: }; michael@0: michael@0: postMessage(JSON.stringify(obj)); michael@0: } michael@0: michael@0: obj = { michael@0: name: "testFinished" michael@0: }; michael@0: michael@0: postMessage(JSON.stringify(obj));