Bug 1427186 - update titlebar even if labels match, iff the tab is selected and this title came from content, r?dao
MozReview-Commit-ID: 53ViIDPPHmh
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -1353,19 +1353,23 @@ window._gBrowser = {
if (!aOptions.isContentTitle) {
// Remove protocol and "www."
if (!("_regex_shortenURLForTabLabel" in this)) {
this._regex_shortenURLForTabLabel = /^[^:]+:\/\/(?:www\.)?/;
}
aLabel = aLabel.replace(this._regex_shortenURLForTabLabel, "");
}
+ let differentContentTitleState = !!aOptions.isContentTitle != !!aTab._labelIsContentTitle;
aTab._labelIsContentTitle = aOptions.isContentTitle;
if (aTab.getAttribute("label") == aLabel) {
+ if (differentContentTitleState && aTab.selected) {
+ this.updateTitlebar();
+ }
return false;
}
let dwu = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
let isRTL = dwu.getDirectionFromText(aLabel) == Ci.nsIDOMWindowUtils.DIRECTION_RTL;
aTab.setAttribute("label", aLabel);