aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-18 15:21:14 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-18 15:21:14 -0700
commita15b0d50618241a345d13ae4d939bfc53178a01d (patch)
treea335c58607d27a23e37dc8a529556667ff38184d
parent695207758b0dccdcacb63eb04ee4eb372841529d (diff)
do not do full Browser.init() in workers, just the minimum we need
-rw-r--r--src/library_browser.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index 9800fedf..925b64e2 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -47,8 +47,11 @@ mergeInto(LibraryManager.library, {
workers: [],
init: function() {
- if (Browser.initted) return;
+ if (!Module["preloadPlugins"]) Module["preloadPlugins"] = []; // needs to exist even in workers
+
+ if (Browser.initted || ENVIRONMENT_IS_WORKER) return;
Browser.initted = true;
+
try {
new Blob();
Browser.hasBlobConstructor = true;
@@ -79,8 +82,6 @@ mergeInto(LibraryManager.library, {
}[name.substr(name.lastIndexOf('.')+1)];
}
- if (!Module["preloadPlugins"]) Module["preloadPlugins"] = [];
-
var imagePlugin = {};
imagePlugin['canHandle'] = function(name) {
return !Module.noImageDecoding && /\.(jpg|jpeg|png|bmp)$/.exec(name);