[Pkg-mozext-commits] [tabmixplus] 08/123: Remove call to TMP_TBP_Startup function from main-window onload Fix incompatibility with Cyberfox. Cyberfox call gCyberfoxCustom.customPrefSettings() from main-window onload

David Prévot taffit at moszumanska.debian.org
Wed Sep 17 21:16:22 UTC 2014


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 0404cc8457090b57b1fecf47311e1515c60e2c0e
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Aug 9 13:23:40 2014 +0300

    Remove call to TMP_TBP_Startup function from main-window onload
    Fix incompatibility with Cyberfox. Cyberfox call gCyberfoxCustom.customPrefSettings() from main-window onload
---
 chrome/content/links/setup.js | 18 +-----------------
 chrome/content/tabmix.js      | 14 ++++++++++++--
 chrome/content/tabmix.xul     |  3 ---
 3 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/chrome/content/links/setup.js b/chrome/content/links/setup.js
index ad178c7..b3a2cf8 100644
--- a/chrome/content/links/setup.js
+++ b/chrome/content/links/setup.js
@@ -44,20 +44,6 @@ Tabmix.linkHandling_init = function TMP_TBP_init(aWindowType) {
   this.openUILink_init();
 }
 
-/**
- * @Theme Vista-aero 3.0.0.91 and BlueSky 3.0.0.91 use TMP_TBP_Startup in stylesheet
- *        window[onload="TMP_TBP_Startup()"]
- */
-function TMP_TBP_Startup() {
-  let onLoad = Tabmix.initialization.run("beforeBrowserInitOnLoad");
-  if (onLoad)
-    onLoad();
-  else if ("gBrowserInit" in window)
-    gBrowserInit.onLoad();
-  else
-    BrowserStartup();
-}
-
 Tabmix.beforeBrowserInitOnLoad = function() {
   try {
     TabmixSvc.windowStartup.init(window);
@@ -209,11 +195,9 @@ Tabmix.beforeBrowserInitOnLoad = function() {
     // add tabmix menu item to tab context menu before menumanipulator and MenuEdit initialize
     TabmixContext.buildTabContextMenu();
 
-    return fnContainer[TMP_BrowserStartup].bind(fnContainer);
+    fnContainer[TMP_BrowserStartup].bind(fnContainer);
 
   } catch (ex) {this.assert(ex);}
-
-  return null;
 }
 
 // this must run before all
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index e0052c9..77560a8 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -271,8 +271,12 @@ var TMP_eventListener = {
     window.removeEventListener(aType, this, false);
     let wintype = window.document.documentElement.getAttribute("windowtype");
     if (wintype == "navigator:browser")
-      Tabmix.initialization.run(aType == "load" ? "onWindowOpen" :
-                                              "onContentLoaded");
+      if (aType != "load") {
+        Tabmix.initialization.run("onContentLoaded");
+        Tabmix.initialization.run("beforeBrowserInitOnLoad");
+      }
+      else
+        Tabmix.initialization.run("onWindowOpen");
     else if (aType != "load")
       window.removeEventListener("load", this, false);
   },
@@ -444,6 +448,12 @@ var TMP_eventListener = {
       }
     }
     else {
+      /**
+       * some theme like Vista-aero 3.0.0.91 and BlueSky 3.0.0.91
+       * use TMP_TBP_Startup in stylesheet window[onload="TMP_TBP_Startup()"]
+       */
+      Tabmix.setItem("main-window", "onload", "TMP_TBP_Startup();");
+
       //XXX need to add theme list here
       var themes = /^(iPoxRemix|Ie8fox|Vfox3)/;
       if (themes.test(skin)) {
diff --git a/chrome/content/tabmix.xul b/chrome/content/tabmix.xul
index a2efabf..8157513 100644
--- a/chrome/content/tabmix.xul
+++ b/chrome/content/tabmix.xul
@@ -36,9 +36,6 @@
    <script type="application/javascript" src="chrome://tabmixplus/content/session/sessionStore.js"/>
    <script type="application/javascript" src="chrome://tabmixplus/content/extensions/extensions.js"/>
 
-  <window id="main-window"
-    onload="TMP_TBP_Startup();" />
-
   <commandset id="mainCommandSet">
     <command id="TabmixSessionUtils:SaveThisWindow" observes="tmp_disableSave"
              oncommand="TabmixSessionManager.sessionUtil('save', 'thiswindow');event.stopPropagation();"/>

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