1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-13 22:05:46 +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 getter: function () !services.get("io").offline
}); });
// TODO: merge with Vimperator version and add Muttator version
// (TB handles this differently).
options.add(["titlestring"], options.add(["titlestring"],
"Change the title of the window", "Change the title of the window",
"string", "Vimperator", "string", "Vimperator",
{ {
setter: function (value) 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); elem.setAttribute("titlemodifier_privatebrowsing", value);
if (window.content.document.title.length > 0) elem.setAttribute("titlemodifier_normal", value);
document.title = window.content.document.title + " - " + value;
else
document.title = value;
}
catch (e)
{
liberator.log("Couldn't set titlestring", 3);
} }
getBrowser().updateTitlebar();
return value; return value;
} }

View File

@@ -528,24 +528,16 @@ const config = { //{{{
getter: function () !services.get("io").offline getter: function () !services.get("io").offline
}); });
// TODO: merge with Vimperator version and add Muttator version
// (TB handles this differently).
options.add(["titlestring"], options.add(["titlestring"],
"Change the title of the window", "Change the title of the window",
"string", "Xulmus", "string", "Xulmus",
{ {
setter: function (value) setter: function (value)
{ {
try document.documentElement.setAttribute("titlemodifier", value);
{ getBrowser().updateTitlebar();
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);
}
return value; return value;
} }