[Pkg-mozext-commits] [tabmixplus] 02/09: Follow up bug 1054740 - When a session should be restored, don't load the homepage before the session file has been read

David Prévot taffit at moszumanska.debian.org
Tue Sep 12 21:30:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit 40326b20f2706c8e5ad5d117bfed5ab2303f5d0d
Author: onemen <tabmix.onemen at gmail.com>
Date:   Thu Aug 31 22:04:16 2017 +0300

    Follow up bug 1054740 - When a session should be restored, don't load the homepage before the session file has been read
---
 chrome/content/links/setup.js | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/chrome/content/links/setup.js b/chrome/content/links/setup.js
index 9a46072..eb71e1f 100644
--- a/chrome/content/links/setup.js
+++ b/chrome/content/links/setup.js
@@ -109,9 +109,10 @@ Tabmix.beforeBrowserInitOnLoad = function() {
       }
     }
 
+    Tabmix._callPrepareLoadOnStartup = this.isVersion(570) && prepareLoadOnStartup;
     if (prepareLoadOnStartup) {
-      Tabmix.prepareLoadOnStartup = function() {
-        let uriToLoad = gBrowserInit._getUriToLoad();
+      Tabmix.prepareLoadOnStartup = function(uriToLoad) {
+        uriToLoad = this.isVersion(570) ? uriToLoad : gBrowserInit._getUriToLoad();
         if (uriToLoad && uriToLoad != TabmixSvc.aboutBlank) {
           let tabs = gBrowser.tabs;
           for (let tab of tabs) {
@@ -143,8 +144,14 @@ Tabmix.beforeBrowserInitOnLoad = function() {
         Tabmix.runningDelayedStartup = false;
       }
 
-      Tabmix.prepareLoadOnStartup();
-      TabmixSessionManager.init();
+      if (Tabmix._callPrepareLoadOnStartup) {
+        gBrowserInit._uriToLoadPromise
+            .then(uriToLoad => Tabmix.prepareLoadOnStartup(uriToLoad))
+            .then(() => TabmixSessionManager.init());
+      } else {
+        Tabmix.prepareLoadOnStartup();
+        TabmixSessionManager.init();
+      }
       Tabmix.initialization.run("afterDelayedStartup");
 
       return result;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list