From f4b94374aedb9dab6b0132a3d9011d6c0bc5a1ed Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 25 Jun 2009 22:43:41 +1000 Subject: [PATCH] Support 'titlestring' in private browsing mode. --- vimperator/content/config.js | 20 ++++++++++---------- xulmus/content/config.js | 16 ++++------------ 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/vimperator/content/config.js b/vimperator/content/config.js index 1dc7219d..9213d508 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -477,24 +477,24 @@ const config = { //{{{ getter: function () !services.get("io").offline }); + // TODO: merge with Vimperator version and add Muttator version + // (TB handles this differently). options.add(["titlestring"], "Change the title of the window", "string", "Vimperator", { setter: function (value) { - try + let elem = document.documentElement; + + elem.setAttribute("titlemodifier", value); + // TODO: remove this FF3.5 test when we no longer support 3.0 + if (Ci.nsIPrivateBrowsingService) { - document.getElementById(config.mainWindowID).setAttribute("titlemodifier", value); - if (window.content.document.title.length > 0) - document.title = window.content.document.title + " - " + value; - else - document.title = value; - } - catch (e) - { - liberator.log("Couldn't set titlestring", 3); + elem.setAttribute("titlemodifier_privatebrowsing", value); + elem.setAttribute("titlemodifier_normal", value); } + getBrowser().updateTitlebar(); return value; } diff --git a/xulmus/content/config.js b/xulmus/content/config.js index a1991f06..8c915a75 100644 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -528,24 +528,16 @@ const config = { //{{{ getter: function () !services.get("io").offline }); + // TODO: merge with Vimperator version and add Muttator version + // (TB handles this differently). options.add(["titlestring"], "Change the title of the window", "string", "Xulmus", { setter: function (value) { - try - { - document.getElementById(config.mainWindowID).setAttribute("titlemodifier", value); - if (window.content.document.title.length > 0) - document.title = window.content.document.title + " - " + value; - else - document.title = value; - } - catch (e) - { - liberator.log("Couldn't set titlestring", 3); - } + document.documentElement.setAttribute("titlemodifier", value); + getBrowser().updateTitlebar(); return value; }