run scripts on background page after onLoad

This commit is contained in:
tg(x) 2016-09-30 20:45:18 +02:00
parent 5e447b8bc2
commit c82c605656

View File

@ -22,20 +22,21 @@
"use strict"; "use strict";
// TypeScript does not allow ".js" extensions in the window.addEventListener("load", () => {
// module name, so SystemJS must add it.
System.config({
defaultJSExtensions: true,
});
// TypeScript does not allow ".js" extensions in the
// module name, so SystemJS must add it.
System.config({
defaultJSExtensions: true,
});
System.import("../lib/wallet/wxMessaging") System.import("../lib/wallet/wxMessaging")
.then((wxMessaging) => { .then((wxMessaging) => {
// Export as global for debugger // Export as global for debugger
(window as any).wxMessaging = wxMessaging; (window as any).wxMessaging = wxMessaging;
wxMessaging.wxMain(); wxMessaging.wxMain();
}) }).catch((e) => {
.catch((e) => { console.log("wallet failed");
console.log("wallet failed"); console.error(e.stack);
console.error(e.stack); });
}); });