mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1218996 - AboutRedirector uses aboutNewTabService exclusively for about:newtab r=mconley
This commit is contained in:
parent
539a002c6d
commit
053128c06f
@ -20,7 +20,7 @@ this.__defineGetter__("BROWSER_NEW_TAB_URL", () => {
|
||||
!aboutNewTabService.overridden) {
|
||||
return "about:privatebrowsing";
|
||||
}
|
||||
return aboutNewTabService.newTabURL;
|
||||
return "about:newtab";
|
||||
});
|
||||
|
||||
var TAB_DROP_TYPE = "application/x-moz-tabbrowser-tab";
|
||||
|
@ -86,7 +86,8 @@ static RedirEntry kRedirMap[] = {
|
||||
nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
|
||||
nsIAboutModule::ALLOW_SCRIPT |
|
||||
nsIAboutModule::ENABLE_INDEXED_DB },
|
||||
{ "newtab", "chrome://browser/content/newtab/newTab.xhtml",
|
||||
// the newtab's actual URL will be determined when the channel is created
|
||||
{ "newtab", "about:blank",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
#ifndef RELEASE_BUILD
|
||||
{ "remote-newtab", "chrome://browser/content/remote-newtab/newTab.xhtml",
|
||||
@ -162,18 +163,12 @@ AboutRedirector::NewChannel(nsIURI* aURI,
|
||||
if (!strcmp(path.get(), kRedirMap[i].id)) {
|
||||
nsAutoCString url;
|
||||
|
||||
// check if about:newtab got overridden
|
||||
if (path.EqualsLiteral("newtab")) {
|
||||
// let the aboutNewTabService decide where to redirect
|
||||
nsCOMPtr<nsIAboutNewTabService> aboutNewTabService =
|
||||
do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv);
|
||||
rv = aboutNewTabService->GetNewTabURL(url);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
bool overridden = false;
|
||||
rv = aboutNewTabService->GetOverridden(&overridden);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (overridden) {
|
||||
rv = aboutNewTabService->GetNewTabURL(url);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
// fall back to the specified url in the map
|
||||
if (url.IsEmpty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user