Index: lib/main.js |
diff --git a/lib/main.js b/lib/main.js |
index df9b54a62a138cac1ca095967a0408a267c41388..000fe45f57204ab5557321a6f522ca79e466d9ae 100644 |
--- a/lib/main.js |
+++ b/lib/main.js |
@@ -12,7 +12,6 @@ |
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); |
const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {}); |
-const {Promise} = Cu.import("resource://gre/modules/Promise.jsm", {}); |
require("commandLine"); |
let {run} = require("crawler"); |
@@ -23,24 +22,19 @@ let baseURL = null; |
* Waits for the application to initialize. |
* @type {Promise} |
*/ |
-let applicationReady = (function() |
+let applicationReady = new Promise((resolve, reject) => |
{ |
- let deferred = Promise.defer(); |
- |
let observer = { |
observe: function(subject, topic, data) |
{ |
Services.obs.removeObserver(this, "sessionstore-windows-restored"); |
- deferred.resolve(); |
+ resolve(); |
}, |
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]) |
}; |
- |
Services.obs.addObserver(observer, "sessionstore-windows-restored", true); |
onShutdown.add(() => Services.obs.removeObserver(observer, "sessionstore-windows-restored")); |
- |
- return deferred.promise; |
-})(); |
+}); |
/** |
* Startup function, called from command line handler. |