[Pkg-mozext-commits] [tabmixplus] 123/147: Starting with Firefox 54.0 we need some timeout before we can accesses the box attributes

David Prévot taffit at moszumanska.debian.org
Sat Aug 5 15:27:44 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 608a5cc1b644822e5ba0da5f178a3b8ffc046d9f
Author: onemen <tabmix.onemen at gmail.com>
Date:   Fri Apr 7 12:52:03 2017 +0300

    Starting with Firefox 54.0 we need some timeout before we can accesses the box attributes
---
 chrome/content/preferences/shortcutsLabels.xml | 13 +++++++++++++
 modules/Shortcuts.jsm                          | 22 ++++++++--------------
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/chrome/content/preferences/shortcutsLabels.xml b/chrome/content/preferences/shortcutsLabels.xml
index 7731eb6..a34a1dd 100644
--- a/chrome/content/preferences/shortcutsLabels.xml
+++ b/chrome/content/preferences/shortcutsLabels.xml
@@ -40,6 +40,19 @@
              switchToLast="&shortcuts.switchToLast;"
              >
     </content>
+    <implementation>
+      <constructor>
+        <![CDATA[
+          let {keys} = Cu.import("resource://tabmixplus/Shortcuts.jsm", {}).Shortcuts;
+          for (let att of this.attributes) {
+            if (keys[att.name]) {
+              keys[att.name].label = att.value;
+            }
+          }
+          this.remove();
+        ]]>
+      </constructor>
+    </implementation>
   </binding>
 
 </bindings>
diff --git a/modules/Shortcuts.jsm b/modules/Shortcuts.jsm
index e9db052..9b42edd 100644
--- a/modules/Shortcuts.jsm
+++ b/modules/Shortcuts.jsm
@@ -76,22 +76,12 @@ this.Shortcuts = {
     // update keys initial value and label
     // get our key labels from shortcutsLabels.xml
     let $ = id => id && aWindow.document.getElementById(id);
-    let container = $("tabmixScrollBox") || $("tabbrowser-tabs");
-    let labels = {};
+    let container = $("TabsToolbar");
     if (container) {
       let box = aWindow.document.createElement("vbox");
       box.setAttribute("shortcutsLabels", true);
       container.appendChild(box);
-      for (let att of box.attributes) {
-        labels[att.name] = att.value;
-      }
-      box.remove();
     }
-    labels.togglePinTab =
-      $("context_pinTab").getAttribute("label") + "/" +
-      $("context_unpinTab").getAttribute("label");
-    labels.clearClosedTabs =
-      TabmixSvc.getString("undoclosetab.clear.label");
     for (let key of Object.keys(this.keys)) {
       let keyData = this.keys[key];
       // get default value for all keys
@@ -109,11 +99,15 @@ this.Shortcuts = {
         }
       }
       keyData.value = keyData.default || "";
-      if (container && key in labels)
-        keyData.label = labels[key];
-      else if (!container && !key.id)
+      if (!container && !key.id) {
         keyData.label = "tabmix_key_" + key;
+      }
     }
+    this.keys.togglePinTab.label =
+        $("context_pinTab").getAttribute("label") + "/" +
+        $("context_unpinTab").getAttribute("label");
+    this.keys.clearClosedTabs.label =
+        TabmixSvc.getString("undoclosetab.clear.label");
 
     if (aWindow.keyconfig) {
       this.keyConfigInstalled = true;

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