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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user