summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/palemoon/base/content/browser.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index 5cf43850a..4167f186c 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -2421,11 +2421,18 @@ function BrowserOnAboutPageLoad(doc) {
/* === about:home === */
if (doc.documentURI.toLowerCase() == "about:home") {
- let ss = Components.classes["@mozilla.org/browser/sessionstore;1"].
- getService(Components.interfaces.nsISessionStore);
- if (ss.canRestoreLastSession &&
- !PrivateBrowsingUtils.isWindowPrivate(window))
- doc.getElementById("launcher").setAttribute("session", "true");
+ if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
+ let wrapper = {};
+ Cu.import("resource:///modules/sessionstore/SessionStore.jsm", wrapper);
+ let ss = wrapper.SessionStore;
+ ss.promiseInitialized.then(function() {
+ if (ss.canRestoreLastSession) {
+ doc.getElementById("launcher").setAttribute("session", "true");
+ }
+ }).then(null, function onError(x) {
+ Cu.reportError("Error in SessionStore init while processing 'about:home': " + x);
+ });
+ }
// Inject search engine and snippets URL.
let docElt = doc.documentElement;