[Pkg-mozext-commits] [tabmixplus] 83/147: Session manager don't save\restore tree. Update compatibility with treeStyleTab version 0.18.2016090601+

David Prévot taffit at moszumanska.debian.org
Sat Aug 5 15:27:39 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 70479ce127e66921b29550bcce3996f14d2ea7af
Author: onemen <tabmix.onemen at gmail.com>
Date:   Mon Jan 2 19:35:40 2017 +0200

    Session manager don't save\restore tree. Update compatibility with treeStyleTab version 0.18.2016090601+
---
 chrome/content/extensions/extensions.js | 13 +++++++++++++
 chrome/content/session/session.js       |  2 ++
 chrome/content/session/sessionStore.js  |  4 ++++
 chrome/content/tab/tabbrowser_4.xml     |  2 +-
 4 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/chrome/content/extensions/extensions.js b/chrome/content/extensions/extensions.js
index 1fca23a..81c44c8 100644
--- a/chrome/content/extensions/extensions.js
+++ b/chrome/content/extensions/extensions.js
@@ -820,4 +820,17 @@ TMP_extensionsCompatibility.treeStyleTab = {
       }, 0);
     }
   },
+
+  getProperties: function(tab) {
+    if (!this.installed) {
+      return "";
+    }
+
+    let props = "TreeStyleTabWindowHelper" in window &&
+        TreeStyleTabWindowHelper.extraProperties || [];
+    props = props.filter(prop => tab.hasAttribute(prop))
+                 .map(prop => `${prop}=${encodeURI(tab.getAttribute(prop))}`)
+                 .join(" ");
+    return props.length ? ` ${props}` : "";
+  },
 };
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index ea872d3..541fc81 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -176,6 +176,8 @@ TabmixSessionData = {
       } catch (ex) {}
     }
 
+    tabProperties += TMP_extensionsCompatibility.treeStyleTab.getProperties(aTab);
+
     return tabProperties;
   },
 
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index d740f24..3e493b2 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -943,6 +943,10 @@ var TabmixConvertSession = {
             extData.tabClr = RegExp.$2;
             break;
           default:
+            // treestyletab data
+            if (RegExp.$1.startsWith("treestyletab-")) {
+              extData[RegExp.$1] = RegExp.$2;
+            }
             tabData.attributes[RegExp.$1] = RegExp.$2;
         }
       });
diff --git a/chrome/content/tab/tabbrowser_4.xml b/chrome/content/tab/tabbrowser_4.xml
index e2e11f5..386a9bb 100644
--- a/chrome/content/tab/tabbrowser_4.xml
+++ b/chrome/content/tab/tabbrowser_4.xml
@@ -249,7 +249,7 @@
       <parameter name="aEvent"/>
       <parameter name="aOver"/>
       <body><![CDATA[
-        var anonid = aEvent.originalTarget.getAttribute("anonid");
+        var anonid = aEvent.originalTarget && aEvent.originalTarget.getAttribute("anonid");
         if (anonid == "tmp-close-button") {
           this.mOverCloseButton = aOver;
         }

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