1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 04:44:20 +01:00

Support 'titlestring' in private browsing mode.

This commit is contained in:
Doug Kearns
2009-06-25 22:43:41 +10:00
parent ddfa294e1b
commit f4b94374ae
2 changed files with 14 additions and 22 deletions

View File

@@ -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;
}

View File

@@ -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;
}