[Pkg-mozext-commits] [tabmixplus] 28/107: Don't add observer before closing a window in single window mode

David Prévot taffit at moszumanska.debian.org
Tue Dec 29 19:02:47 UTC 2015


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 2e9860146613776bcb3df5a96a4d4dc91ddd102c
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Oct 24 15:42:32 2015 +0300

    Don't add observer before closing a window in single window mode
---
 modules/SingleWindowModeUtils.jsm | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/modules/SingleWindowModeUtils.jsm b/modules/SingleWindowModeUtils.jsm
index 2ffb8e8..900bfad 100644
--- a/modules/SingleWindowModeUtils.jsm
+++ b/modules/SingleWindowModeUtils.jsm
@@ -169,18 +169,22 @@ this.SingleWindowModeUtils = {
         newWindow.PlacesStarButton.uninit = function() {};
       }
       newWindow.OfflineApps.uninit = function() {};
-      var obs = Services.obs;
-      obs.addObserver(newWindow.gSessionHistoryObserver, "browser:purge-session-history", false);
-      if (!TabmixSvc.version(340))
-        obs.addObserver(newWindow.gFormSubmitObserver, "invalidformsubmit", false);
       newWindow.IndexedDBPromptHelper.init();
-      obs.addObserver(newWindow.gXPInstallObserver, "addon-install-blocked", false);
-      obs.addObserver(newWindow.gXPInstallObserver, "addon-install-failed", false);
-      obs.addObserver(newWindow.gXPInstallObserver, "addon-install-complete", false);
-      let pluginCrashed = TabmixSvc.version(400) ? "NPAPIPluginCrashed" : "pluginCrashed";
-      obs.addObserver(newWindow.gPluginHandler[pluginCrashed], "plugin-crashed", false);
+      var obs = Services.obs;
+      if (!TabmixSvc.version(440)) {
+        obs.addObserver(newWindow.gSessionHistoryObserver, "browser:purge-session-history", false);
+        if (!TabmixSvc.version(340))
+          obs.addObserver(newWindow.gFormSubmitObserver, "invalidformsubmit", false);
+        obs.addObserver(newWindow.gXPInstallObserver, "addon-install-blocked", false);
+        obs.addObserver(newWindow.gXPInstallObserver, "addon-install-failed", false);
+        obs.addObserver(newWindow.gXPInstallObserver, "addon-install-complete", false);
+        let pluginCrashed = TabmixSvc.version(400) ? "NPAPIPluginCrashed" : "pluginCrashed";
+        obs.addObserver(newWindow.gPluginHandler[pluginCrashed], "plugin-crashed", false);
+      }
       newWindow.gPrivateBrowsingUI.uninit = function() {};
-      existingWindow.setTimeout(function() {
+    } catch (ex) {existingWindow.Tabmix.obj(ex);}
+    existingWindow.setTimeout(function() {
+      try {
         // restore window dimensions, to prevent flickring in the next restart
         var win = newWindow.document.documentElement;
         if (typeof newWindow.__winRect == "object") {
@@ -194,7 +198,7 @@ this.SingleWindowModeUtils = {
         }
         // for the case the window is minimized or not in focus
         existingWindow.focus();
-      }, 0);
-    } catch (ex) {existingWindow.Tabmix.obj(ex);}
+      } catch (ex) {existingWindow.Tabmix.obj(ex);}
+    }, 0);
   }
 };

-- 
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