|
@@ -1,13 +1,13 @@
|
|
var util = {
|
|
var util = {
|
|
-
|
|
|
|
|
|
+
|
|
chromeCompatible: true,
|
|
chromeCompatible: true,
|
|
- firefoxCompatible: false,
|
|
|
|
|
|
+ firefoxCompatible: true,
|
|
chromeVersion: 26,
|
|
chromeVersion: 26,
|
|
firefoxVersion: 22,
|
|
firefoxVersion: 22,
|
|
|
|
|
|
debug: false,
|
|
debug: false,
|
|
browserisms: '',
|
|
browserisms: '',
|
|
-
|
|
|
|
|
|
+
|
|
inherits: function(ctor, superCtor) {
|
|
inherits: function(ctor, superCtor) {
|
|
ctor.super_ = superCtor;
|
|
ctor.super_ = superCtor;
|
|
ctor.prototype = Object.create(superCtor.prototype, {
|
|
ctor.prototype = Object.create(superCtor.prototype, {
|
|
@@ -32,7 +32,7 @@ var util = {
|
|
randomPort: function() {
|
|
randomPort: function() {
|
|
return Math.round(Math.random() * 60535) + 5000;
|
|
return Math.round(Math.random() * 60535) + 5000;
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
log: function () {
|
|
log: function () {
|
|
if (util.debug) {
|
|
if (util.debug) {
|
|
var err = false;
|
|
var err = false;
|
|
@@ -58,7 +58,7 @@ var util = {
|
|
function setZeroTimeoutPostMessage(fn) {
|
|
function setZeroTimeoutPostMessage(fn) {
|
|
timeouts.push(fn);
|
|
timeouts.push(fn);
|
|
global.postMessage(messageName, '*');
|
|
global.postMessage(messageName, '*');
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
function handleMessage(event) {
|
|
function handleMessage(event) {
|
|
if (event.source == global && event.data == messageName) {
|
|
if (event.source == global && event.data == messageName) {
|
|
@@ -77,7 +77,7 @@ var util = {
|
|
}
|
|
}
|
|
return setZeroTimeoutPostMessage;
|
|
return setZeroTimeoutPostMessage;
|
|
}(this)),
|
|
}(this)),
|
|
-
|
|
|
|
|
|
+
|
|
blobToArrayBuffer: function(blob, cb){
|
|
blobToArrayBuffer: function(blob, cb){
|
|
var fr = new FileReader();
|
|
var fr = new FileReader();
|
|
fr.onload = function(evt) {
|
|
fr.onload = function(evt) {
|