Bug 948983: Make about:newtab the start page with about:home and about:start as aliases and save all as about:newtab in sessionstore. r=mbrubeck

This commit is contained in:
Marina Samuel 2013-12-12 15:55:31 -05:00
Родитель 4be83d4a79
Коммит 4fd613f1e0
7 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -209,6 +209,7 @@ let Util = {
aURL == "about:blank" ||
aURL == "about:empty" ||
aURL == "about:home" ||
aURL == "about:newtab" ||
aURL == "about:start");
},

Просмотреть файл

@ -347,6 +347,12 @@ let WebNavigation = {
let history = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory;
for (let i = 0; i < history.count; i++) {
let entry = this._serializeHistoryEntry(history.getEntryAtIndex(i, false));
// If someone directly navigates to one of these URLs and they switch to Desktop,
// we need to make the page load-able.
if (entry.url == "about:home" || entry.url == "about:start") {
entry.url = "about:newtab";
}
entries.push(entry);
}
let index = history.index + 1;

Просмотреть файл

@ -308,7 +308,7 @@ var BrowserUI = {
isStartURI: function isStartURI(aURI) {
aURI = aURI || Browser.selectedBrowser.currentURI.spec;
return aURI == kStartURI || aURI == "about:home";
return aURI == kStartURI || aURI == "about:start" || aURI == "about:home";
},
updateStartURIAttributes: function (aURI) {

Просмотреть файл

@ -11,7 +11,7 @@ let Cr = Components.results;
Cu.import("resource://gre/modules/PageThumbs.jsm");
// Page for which the start UI is shown
const kStartURI = "about:start";
const kStartURI = "about:newtab";
// allow panning after this timeout on pages with registered touch listeners
const kTouchTimeout = 300;

Просмотреть файл

@ -8,7 +8,7 @@ const Ci = Components.interfaces;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
let modules = {
start: {
newtab: {
uri: "chrome://browser/content/Start.xul",
privileged: true
},
@ -37,8 +37,12 @@ let modules = {
uri: "chrome://browser/content/aboutCertError.xhtml",
privileged: true
},
start: {
uri: "about:newtab",
privileged: true
},
home: {
uri: "about:start",
uri: "about:newtab",
privileged: true
},
#ifdef MOZ_CRASHREPORTER

Просмотреть файл

@ -73,7 +73,7 @@ function needHomepageOverride() {
}
function getHomePage() {
let url = "about:start";
let url = "about:newtab";
try {
url = Services.prefs.getComplexValue("browser.startup.homepage", Ci.nsIPrefLocalizedString).data;
} catch (e) { }

Просмотреть файл

@ -5,6 +5,7 @@ contract @mozilla.org/network/protocol/about;1?what=empty {433d2d75-5923-49b0-85
contract @mozilla.org/network/protocol/about;1?what=firefox {433d2d75-5923-49b0-854d-f37267b03dc7}
contract @mozilla.org/network/protocol/about;1?what=rights {433d2d75-5923-49b0-854d-f37267b03dc7}
contract @mozilla.org/network/protocol/about;1?what=certerror {433d2d75-5923-49b0-854d-f37267b03dc7}
contract @mozilla.org/network/protocol/about;1?what=newtab {433d2d75-5923-49b0-854d-f37267b03dc7}
contract @mozilla.org/network/protocol/about;1?what=home {433d2d75-5923-49b0-854d-f37267b03dc7}
#ifdef MOZ_CRASHREPORTER
contract @mozilla.org/network/protocol/about;1?what=crashprompt {433d2d75-5923-49b0-854d-f37267b03dc7}