aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortg(x) <*@tg-x.net>2016-09-30 20:45:18 +0200
committertg(x) <*@tg-x.net>2016-09-30 20:45:18 +0200
commitc82c605656d0e88a9703c563d9480a144fb00cd9 (patch)
tree0f4f540e11d07921f3abf9f024df117b50ee6cdd
parent5e447b8bc285728a456b0f0c4ec663e36a824065 (diff)
downloadwallet-core-c82c605656d0e88a9703c563d9480a144fb00cd9.tar.xz
run scripts on background page after onLoad
-rw-r--r--background/main.ts37
1 files changed, 19 insertions, 18 deletions
diff --git a/background/main.ts b/background/main.ts
index 60046e733..f039f9aea 100644
--- a/background/main.ts
+++ b/background/main.ts
@@ -16,26 +16,27 @@
/**
* Entry point for the background page.
- *
+ *
* @author Florian Dold
*/
"use strict";
-// TypeScript does not allow ".js" extensions in the
-// module name, so SystemJS must add it.
-System.config({
- defaultJSExtensions: true,
- });
-
-
-System.import("../lib/wallet/wxMessaging")
- .then((wxMessaging) => {
- // Export as global for debugger
- (window as any).wxMessaging = wxMessaging;
- wxMessaging.wxMain();
- })
- .catch((e) => {
- console.log("wallet failed");
- console.error(e.stack);
- });
+window.addEventListener("load", () => {
+
+ // TypeScript does not allow ".js" extensions in the
+ // module name, so SystemJS must add it.
+ System.config({
+ defaultJSExtensions: true,
+ });
+
+ System.import("../lib/wallet/wxMessaging")
+ .then((wxMessaging) => {
+ // Export as global for debugger
+ (window as any).wxMessaging = wxMessaging;
+ wxMessaging.wxMain();
+ }).catch((e) => {
+ console.log("wallet failed");
+ console.error(e.stack);
+ });
+});