зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1224950 - Limit Message-Using Remote New Tab to Nightly and Aurora r=mconley
--HG-- extra : commitid : 7WhGDvbiS1o
This commit is contained in:
Родитель
f81fa4f5dd
Коммит
a10c269286
|
@ -1343,8 +1343,10 @@ pref("browser.newtabpage.directory.source", "https://tiles.services.mozilla.com/
|
|||
// endpoint to send newtab click and view pings
|
||||
pref("browser.newtabpage.directory.ping", "https://tiles.services.mozilla.com/v3/links/");
|
||||
|
||||
// activates the remote-hosted newtab page
|
||||
#ifndef RELEASE_BUILD
|
||||
// if true, it activates the remote-hosted newtab page
|
||||
pref("browser.newtabpage.remote", false);
|
||||
#endif
|
||||
|
||||
// Enable the DOM fullscreen API.
|
||||
pref("full-screen-api.enabled", true);
|
||||
|
@ -1666,4 +1668,4 @@ pref("toolkit.pageThumbs.minHeight", 190);
|
|||
#ifdef NIGHTLY_BUILD
|
||||
// Enable speech synthesis, only Nightly for now
|
||||
pref("media.webspeech.synth.enabled", true);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -90,9 +90,11 @@ static RedirEntry kRedirMap[] = {
|
|||
nsIAboutModule::ENABLE_INDEXED_DB },
|
||||
{ "newtab", "chrome://browser/content/newtab/newTab.xhtml",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
#ifndef RELEASE_BUILD
|
||||
{ "remote-newtab", "chrome://browser/content/remote-newtab/newTab.xhtml",
|
||||
nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
#endif
|
||||
{ "preferences", "chrome://browser/content/preferences/in-content/preferences.xul",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
{ "downloads", "chrome://browser/content/downloads/contentAreaDownloadsView.xul",
|
||||
|
|
|
@ -4,17 +4,18 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
|
||||
if not CONFIG['RELEASE_BUILD']:
|
||||
BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += [
|
||||
'tests/xpcshell/xpcshell.ini',
|
||||
]
|
||||
XPCSHELL_TESTS_MANIFESTS += [
|
||||
'tests/xpcshell/xpcshell.ini',
|
||||
]
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
'NewTabPrefsProvider.jsm',
|
||||
'NewTabURL.jsm',
|
||||
'PlacesProvider.jsm',
|
||||
'RemoteAboutNewTab.jsm',
|
||||
'RemoteNewTabLocation.jsm',
|
||||
'RemoteNewTabUtils.jsm',
|
||||
]
|
||||
EXTRA_JS_MODULES += [
|
||||
'NewTabPrefsProvider.jsm',
|
||||
'NewTabURL.jsm',
|
||||
'PlacesProvider.jsm',
|
||||
'RemoteAboutNewTab.jsm',
|
||||
'RemoteNewTabLocation.jsm',
|
||||
'RemoteNewTabUtils.jsm',
|
||||
]
|
||||
|
|
|
@ -14,6 +14,9 @@ const POLARIS_ENABLED = "browser.polaris.enabled";
|
|||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AboutHome",
|
||||
"resource:///modules/AboutHome.jsm");
|
||||
|
||||
|
@ -26,14 +29,16 @@ XPCOMUtils.defineLazyModuleGetter(this, "DirectoryLinksProvider",
|
|||
XPCOMUtils.defineLazyModuleGetter(this, "NewTabUtils",
|
||||
"resource://gre/modules/NewTabUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RemoteAboutNewTab",
|
||||
"resource:///modules/RemoteAboutNewTab.jsm");
|
||||
if(!AppConstants.RELEASE_BUILD) {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RemoteAboutNewTab",
|
||||
"resource:///modules/RemoteAboutNewTab.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RemoteNewTabUtils",
|
||||
"resource:///modules/RemoteNewTabUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RemoteNewTabUtils",
|
||||
"resource:///modules/RemoteNewTabUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
|
||||
"resource:///modules/NewTabPrefsProvider.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
|
||||
"resource:///modules/NewTabPrefsProvider.jsm");
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UITour",
|
||||
"resource:///modules/UITour.jsm");
|
||||
|
@ -181,9 +186,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
|
|||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
|
||||
"resource://gre/modules/ExtensionManagement.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "WindowsUIUtils",
|
||||
"@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils");
|
||||
|
||||
|
@ -849,10 +851,12 @@ BrowserGlue.prototype = {
|
|||
NewTabUtils.links.addProvider(DirectoryLinksProvider);
|
||||
AboutNewTab.init();
|
||||
|
||||
RemoteNewTabUtils.init();
|
||||
RemoteNewTabUtils.links.addProvider(DirectoryLinksProvider);
|
||||
RemoteAboutNewTab.init();
|
||||
NewTabPrefsProvider.prefs.init();
|
||||
if(!AppConstants.RELEASE_BUILD) {
|
||||
RemoteNewTabUtils.init();
|
||||
RemoteNewTabUtils.links.addProvider(DirectoryLinksProvider);
|
||||
RemoteAboutNewTab.init();
|
||||
NewTabPrefsProvider.prefs.init();
|
||||
}
|
||||
|
||||
SessionStore.init();
|
||||
BrowserUITelemetry.init();
|
||||
|
@ -1173,8 +1177,10 @@ BrowserGlue.prototype = {
|
|||
CustomizationTabPreloader.uninit();
|
||||
WebappManager.uninit();
|
||||
|
||||
RemoteAboutNewTab.uninit();
|
||||
NewTabPrefsProvider.prefs.uninit();
|
||||
if (!AppConstants.RELEASE_BUILD) {
|
||||
RemoteAboutNewTab.uninit();
|
||||
NewTabPrefsProvider.prefs.uninit();
|
||||
}
|
||||
AboutNewTab.uninit();
|
||||
#ifdef NIGHTLY_BUILD
|
||||
if (Services.prefs.getBoolPref("dom.identity.enabled")) {
|
||||
|
@ -2585,9 +2591,11 @@ AboutNewTabService.prototype = {
|
|||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutNewTabService]),
|
||||
|
||||
get newTabURL() {
|
||||
if (Services.prefs.getBoolPref("browser.newtabpage.remote")) {
|
||||
|
||||
if (!AppConstants.RELEASE_BUILD && Services.prefs.getBoolPref("browser.newtabpage.remote")) {
|
||||
return "about:remote-newtab";
|
||||
}
|
||||
|
||||
return this._newTabURL;
|
||||
},
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://gre/modules/Timer.jsm");
|
||||
Cu.import("resource://gre/modules/AppConstants.jsm")
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
|
@ -31,8 +32,13 @@ XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
|
|||
XPCOMUtils.defineLazyServiceGetter(this, "eTLD",
|
||||
"@mozilla.org/network/effective-tld-service;1",
|
||||
"nsIEffectiveTLDService");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RemoteNewTabUtils",
|
||||
"resource:///modules/RemoteNewTabUtils.jsm");
|
||||
|
||||
// ensure remote new tab doesn't go beyond aurora
|
||||
if (!AppConstants.RELEASE_BUILD) {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RemoteNewTabUtils",
|
||||
"resource:///modules/RemoteNewTabUtils.jsm");
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gTextDecoder", () => {
|
||||
return new TextDecoder();
|
||||
});
|
||||
|
@ -760,8 +766,12 @@ var DirectoryLinksProvider = {
|
|||
|
||||
NewTabUtils.placesProvider.addObserver(this);
|
||||
NewTabUtils.links.addObserver(this);
|
||||
RemoteNewTabUtils.placesProvider.addObserver(this);
|
||||
RemoteNewTabUtils.links.addObserver(this);
|
||||
|
||||
// ensure remote new tab doesn't go beyond aurora
|
||||
if (!AppConstants.RELEASE_BUILD) {
|
||||
RemoteNewTabUtils.placesProvider.addObserver(this);
|
||||
RemoteNewTabUtils.links.addObserver(this);
|
||||
}
|
||||
|
||||
return Task.spawn(function() {
|
||||
// get the last modified time of the links file if it exists
|
||||
|
|
Загрузка…
Ссылка в новой задаче