From 2574f77b401cf58c39b4a83f7bd88bacf5b11784 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 25 Sep 2014 23:54:28 +0400 Subject: [PATCH] Add tabs counter to titlebar customization (#152) --- extension/chrome/content/browser.js | 4 ++++ extension/chrome/content/nightly.js | 1 + extension/chrome/content/titlebar/customize.js | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extension/chrome/content/browser.js b/extension/chrome/content/browser.js index c439c57..980cb18 100644 --- a/extension/chrome/content/browser.js +++ b/extension/chrome/content/browser.js @@ -17,6 +17,10 @@ get tabTitle() { var tabbrowser = document.getElementById("content"); return tabbrowser.mCurrentBrowser.contentTitle; }, +get tabsCount() { + var tabbrowser = document.getElementById("content"); + return tabbrowser.visibleTabs.length; +}, init: function() { diff --git a/extension/chrome/content/nightly.js b/extension/chrome/content/nightly.js index d9d37d4..05b49ce 100644 --- a/extension/chrome/content/nightly.js +++ b/extension/chrome/content/nightly.js @@ -37,6 +37,7 @@ variables: { get compiler() this.appInfo.XPCOMABI.split("-")[1], get defaulttitle() { return nightlyApp.defaultTitle; }, get tabtitle() { return nightlyApp.tabTitle; }, + get tabscount() {return nightlyApp.tabsCount; }, profile: null, toolkit: "cairo", flags: "" diff --git a/extension/chrome/content/titlebar/customize.js b/extension/chrome/content/titlebar/customize.js index 7310eb5..684360b 100644 --- a/extension/chrome/content/titlebar/customize.js +++ b/extension/chrome/content/titlebar/customize.js @@ -102,7 +102,7 @@ init: function(aEvent) paneTitle.addVariable("Compiler"); paneTitle.addVariable("Toolkit"); paneTitle.addVariable("Profile"); - + paneTitle.addVariable("TabsCount"); paneTitle.setupTree(); },