aboutsummaryrefslogtreecommitdiff
path: root/extension/background/main.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-02-10 02:03:31 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-02-10 02:03:31 +0100
commita04a9d0424564d942872ba1137eac413a169f0f2 (patch)
treee1209f853cf8b75b7b1fc371b926a30aa999d47d /extension/background/main.ts
parent14f636d6708edfcd883421ad76c6da1ce6dd27b9 (diff)
refactoring / cosmetic changes
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);