Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #31 - nightly.oldUpdateTitlebar -> getter / setter, even more c…

…hecks
  • Loading branch information...
commit 6b147ac17afa7292e5d330751374e362051e0f91 1 parent 22afc5a
@xabolcs authored
Showing with 19 additions and 5 deletions.
  1. +19 −5 extension/chrome/content/suite.js
View
24 extension/chrome/content/suite.js
@@ -6,9 +6,23 @@ var nightlyApp = {
repository: ['comm-central','comm-aurora'],
-oldUpdateTitlebar: null,
+_oldUpdateTitlebar: null,
debugQATitleModifierWorkaround: null,
+get oldUpdateTitlebar() {
+ if (!nightlyApp._oldUpdateTitlebar) {
+ Components.utils.import("resource://nightly/Logging.jsm");
+ WARN("No suitable titlebar function was found! Titlebar customization is incomplete! Please file a bug!");
+ }
+ return nightlyApp._oldUpdateTitlebar;
+},
+
+set oldUpdateTitlebar(aParam) {
+ if (typeof(aParam) === "function") {
+ nightlyApp._oldUpdateTitlebar = aParam;
+ }
+},
+
get defaultTitle() {
if (nightlyApp.oldUpdateTitlebar) {
return nightlyApp.getWindowTitleForNavigator(gBrowser.mCurrentBrowser);
@@ -30,7 +44,7 @@ init: function()
}
nightly.variables.brandname=brandbundle.getString("brandFullName");
- if (gBrowser && typeof(gBrowser.updateTitlebar) === "function") {
+ if (typeof(gBrowser) !== "undefined" && typeof(gBrowser.updateTitlebar) === "function") {
nightlyApp.oldUpdateTitlebar = gBrowser.updateTitlebar;
gBrowser.updateTitlebar = nightly.updateTitlebar;
@@ -57,15 +71,15 @@ openURL: function(url, event)
setCustomTitle: function(title)
{
- gBrowser.ownerDocument.title = title;
+ if (nightlyApp.oldUpdateTitlebar) {
+ gBrowser.ownerDocument.title = title;
+ }
},
setStandardTitle: function()
{
if (nightlyApp.oldUpdateTitlebar) {
nightlyApp.oldUpdateTitlebar.call(gBrowser);
- } else {
- gBrowser.updateTitlebar.call(gBrowser);
}
},
Please sign in to comment.
Something went wrong with that request. Please try again.