Bug 799001 - Part 3: Hook up about:privatebrowsing to load when opening a new private window; r=jdm

This page needs to be revamped later on to make sure that it fits the
new world!
This commit is contained in:
Ehsan Akhgari 2012-10-07 23:53:29 -04:00
parent 4f98fdefe4
commit dded6844bb
2 changed files with 5 additions and 4 deletions

View File

@ -3529,6 +3529,8 @@ function OpenBrowserWindow(options)
"private" in options &&
options.private) {
extraFeatures = ",private";
// Force the new window to load about:privatebrowsing instead of the default home page
defaultArgs = "about:privatebrowsing";
}
#endif

View File

@ -42,10 +42,9 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
var pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
if (!pb.privateBrowsingEnabled) {
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
document.title = "]]>&privatebrowsingpage.title.normal;<![CDATA[";
setFavIcon("chrome://global/skin/icons/question-16.png");
} else {
@ -81,7 +80,7 @@
}
document.addEventListener("DOMContentLoaded", function () {
if (!pb.privateBrowsingEnabled) {
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
document.body.setAttribute("class", "normal");
}