aboutsummaryrefslogtreecommitdiff
path: root/extension/background/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'extension/background/main.ts')
-rw-r--r--extension/background/main.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/extension/background/main.ts b/extension/background/main.ts
index 7d607aa49..5fdee658e 100644
--- a/extension/background/main.ts
+++ b/extension/background/main.ts
@@ -20,16 +20,22 @@
"use strict";
+// TypeScript does not allow ".js" extensions in the
+// module name, so SystemJS must add it.
System.config({
defaultJSExtensions: true,
});
-var Module: any;
-
+// We expect that in the manifest, the emscripten js is loaded
+// becore the background page.
+// Currently it is not possible to use SystemJS to load the emscripten js.
+declare var Module: any;
if ("object" !== typeof Module) {
throw Error("emscripten not loaded, no 'Module' defined");
}
+// Manually register the emscripten js as a SystemJS, so that
+// we can use it from TypeScript by importing it.
let mod = System.newModule({Module: Module});
let modName = System.normalizeSync("../lib/emscripten/emsc");
console.log("registering", modName);