[Pkg-mozext-commits] [tabmixplus] 13/48: Follow up bug 1367630 - Tab titles are pretty broken when pages don't have a <title> element

David Prévot taffit at moszumanska.debian.org
Sun Aug 20 03:14:35 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 f4935d5675bfb5522f0ef4ac6633e7fb6f85e129
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Aug 5 14:16:57 2017 +0300

    Follow up bug 1367630 - Tab titles are pretty broken when pages don't have a <title> element
---
 chrome/content/minit/tablib.js  | 17 ++++++++++-------
 chrome/content/places/places.js |  2 +-
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 80969d5..6405121 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -329,7 +329,7 @@ Tabmix.tablib = {
       [obj, fnName] = [gBrowser, "setTabTitle"];
     }
     Tabmix.changeCode(obj, "gBrowser." + fnName)._replace(
-      'var title = browser.contentTitle;',
+      Tabmix.isVersion(550) ? 'let isContentTitle = false;' : 'var title = browser.contentTitle;',
       '$&\
        var urlTitle, title = Tabmix.tablib.getTabTitle(aTab, browser.currentURI.spec, title);'
     )._replace(
@@ -360,13 +360,16 @@ Tabmix.tablib = {
     ).toCode();
 
     if (Tabmix.isVersion(550)) {
+      Tabmix.originalFunctions.gBrowser_setInitialTabTitle = gBrowser.setInitialTabTitle;
+      gBrowser.setInitialTabTitle = function(aTab) {
+        if (aTab._labelIsInitialTitle &&
+            aTab.hasAttribute("tabmix_changed_label")) {
+          return;
+        }
+        Tabmix.originalFunctions.gBrowser_setInitialTabTitle.apply(this, arguments);
+      };
+
       Tabmix.changeCode(gBrowser, "gBrowser._setTabLabel")._replace(
-        '{',
-        `{
-            if (aLabel == TabmixSvc.aboutBlank) {
-              aLabel = this.mStringBundle.getString("tabs.emptyTabTitle");
-            }`
-      )._replace(
         'this._tabAttrModified',
         `let urlTitle = aOptions && aOptions.urlTitle;
               Tabmix.tablib.onTabTitleChanged(aTab, aTab.linkedBrowser, aLabel == urlTitle);
diff --git a/chrome/content/places/places.js b/chrome/content/places/places.js
index 78aa50d..388eeb5 100644
--- a/chrome/content/places/places.js
+++ b/chrome/content/places/places.js
@@ -322,7 +322,7 @@ var TMP_Places = {
       }
       this.setTabTitle(aTab, url, bmIds[i]);
       if (Tabmix.isVersion(550)) {
-        aTab._suppressTransientPlaceholderLabel = true;
+        aTab._labelIsInitialTitle = true;
       }
       if (loadProgressively) {
         tabs.push(aTab);

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