Bug 348076 remove generated URLs from region.properties (r=phil, sr=mconnor)

This commit is contained in:
dietrich%mozilla.com 2006-08-19 02:00:52 +00:00
parent 51b0babe5e
commit ec11f116b2
9 changed files with 49 additions and 36 deletions

View File

@ -48,8 +48,30 @@
#endif
#endif
pref("startup.homepage_override_url","chrome://browser-region/locale/region.properties");
pref("startup.homepage_welcome_url","chrome://browser-region/locale/region.properties");
#ifdef OFFICIAL_BRANDING
pref("startup.homepage_override_url","http://%LOCALE%.www.mozilla.com/%LOCALE%/firefox/%VERSION%/whatsnew/");
pref("startup.homepage_welcome_url","http://%LOCALE%.www.mozilla.com/%LOCALE%/firefox/%VERSION%/firstrun/");
// URL user can browse to manually if for some reason all update installation
// attempts fail.
pref("app.update.url.manual", "http://%LOCALE%.www.mozilla.com/%LOCALE%/products/firefox/");
// A default value for the "More information about this update" link
// supplied in the "An update is available" page of the update wizard.
pref("app.update.url.details", "http://%LOCALE%.www.mozilla.com/%LOCALE%/firefox/releases/");
#else
pref("startup.homepage_override_url","http://www.mozilla.org/projects/firefox/%VERSION%/whatsnew/");
pref("startup.homepage_welcome_url","http://www.mozilla.org/projects/firefox/%VERSION%/firstrun/");
// URL user can browse to manually if for some reason all update installation
// attempts fail.
pref("app.update.url.manual", "http://www.mozilla.org/products/firefox/");
// A default value for the "More information about this update" link
// supplied in the "An update is available" page of the update wizard.
pref("app.update.url.details", "http://www.mozilla.org/projects/firefox/");
#endif
pref("general.startup.browser", true);
pref("browser.chromeURL","chrome://browser/content/");
@ -74,7 +96,7 @@ pref("extensions.hideInstallButton", true);
pref("extensions.blocklist.enabled", true);
pref("extensions.blocklist.interval", 86400);
pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/1/%APP_ID%/%APP_VERSION%/");
pref("extensions.blocklist.detailsURL", "http://www.mozilla.com/blocklist/");
pref("extensions.blocklist.detailsURL", "http://%LOCALE%.www.mozilla.com/%LOCALE%/blocklist/");
// Dictionary download preference
pref("browser.dictionaries.download.url", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/firefox/%VERSION%/dictionaries/");
@ -105,12 +127,8 @@ pref("app.update.silent", false);
// Update service URL:
pref("app.update.url", "https://aus2.mozilla.org/update/2/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/update.xml");
// URL user can browse to manually if for some reason all update installation
// attempts fail. TODO: Change this URL
pref("app.update.url.manual", "http://www.mozilla.org/products/firefox/");
// A default value for the "More information about this update" link
// supplied in the "An update is available" page of the update wizard.
pref("app.update.url.details", "chrome://browser-region/locale/region.properties");
// app.update.url.manual is in branding section
// app.update.url.details is in branding section
// User-settable override to app.update.url for testing purposes.
//pref("app.update.url.override", "");
@ -154,8 +172,8 @@ pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.pro
pref("extensions.update.interval", 86400); // Check for updates to Extensions and
// Themes every day
// Non-symmetric (not shared by extensions) extension-specific [update] preferences
pref("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensions.properties");
pref("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.properties");
pref("extensions.getMoreExtensionsURL", "http://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/extensions/");
pref("extensions.getMoreThemesURL", "http://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/themes/");
pref("extensions.dss.enabled", false); // Dynamic Skin Switching
pref("extensions.dss.switchPending", false); // Non-dynamic switch pending after next
// restart.

View File

@ -406,17 +406,17 @@ var nsBrowserContentHandler = {
get defaultArgs() {
var prefb = Components.classes["@mozilla.org/preferences-service;1"]
.getService(nsIPrefBranch);
var formatter = Components.classes["@mozilla.org/browser/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var pagesToLoad = "";
var overrideState = needHomepageOverride(prefb);
try {
if (overrideState == 1) {
pagesToLoad = prefb.getComplexValue("startup.homepage_welcome_url",
nsIPrefLocalizedString).data;
pagesToLoad = formatter.formatURLPref("startup.homepage_welcome_url", null);
}
else if (overrideState == 2) {
pagesToLoad = prefb.getComplexValue("startup.homepage_override_url",
nsIPrefLocalizedString).data;
pagesToLoad = formatter.formatURLPref("startup.homepage_override_url", null);
}
}
catch (e) {

View File

@ -9,14 +9,6 @@ browser.search.order.2=Yahoo
searchEnginesURL=https://addons.mozilla.org/search-engines.php
# This page gets displayed on first start and update
startup.homepage_override_url=http://www.mozilla.com/firefox/updated
startup.homepage_welcome_url=http://www.mozilla.com/firefox/central
# This is the fallback URL for release notes. Do not change this
# unless you are providing localized release notes!
app.update.url.details=http://www.mozilla.com/firefox/releases/
# This is the default set of web based feed handlers shown in the reader
# selection UI
browser.contentHandlers.types.0.title=Bloglines

View File

@ -32,8 +32,6 @@ disableWarningDependMessage=If you disable %S, the following items that require
disableQueryMessage=Do you want to disable %S?
extensions.update.url=https://addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%
extensions.getMoreExtensionsURL=https://addons.mozilla.org/extensions/?application=%APPID%
extensions.getMoreThemesURL=https://addons.mozilla.org/themes/?application=%APPID%
themesTitle=Themes
extensionsTitle=Extensions

View File

@ -331,10 +331,10 @@ function showView(aView) {
"tooltiptextextensions"));
getMore.setAttribute("value", getMore.getAttribute(isThemes ? "valuethemes" :
"valueextensions"));
var getMoreURL = gPref.getComplexValue(isThemes ? PREF_EXTENSIONS_GETMORETHEMESURL
: PREF_EXTENSIONS_GETMOREEXTENSIONSURL,
Components.interfaces.nsIPrefLocalizedString).data;
getMoreURL = getMoreURL.replace(/%APPID%/g, gAppID);
var getMorePref = isThemes ? PREF_EXTENSIONS_GETMORETHEMESURL : PREF_EXTENSIONS_GETMOREEXTENSIONSURL;
var formatter = Components.classes["@mozilla.org/browser/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var getMoreURL = formatter.formatURLPref(getMorePref, null);
getMore.setAttribute("getMoreURL", getMoreURL);
if (getMore.hidden)
getMore.hidden = false;

View File

@ -233,7 +233,9 @@
var blocklistMoreInfo = document.getAnonymousElementByAttribute(this, "anonid", "blocklistMoreInfo");
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var url = prefs.getCharPref("extensions.blocklist.detailsURL");
var formatter = Components.classes["@mozilla.org/browser/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var url = formatter.formatURLPref("extensions.blocklist.detailsURL", null);
blocklistMoreInfo.setAttribute("moreInfoURL", url);
} catch(e) {
blocklistMoreInfo.hidden = true;

View File

@ -88,10 +88,10 @@ function init() {
items.push(args.GetString(i));
var extensionsBundle = document.getElementById("extensionsBundle");
var pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
try {
var url = pref.getCharPref("extensions.blocklist.detailsURL");
var formatter = Components.classes["@mozilla.org/browser/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var url = formatter.formatURLPref("extensions.blocklist.detailsURL", null);
}
catch (e) { }

View File

@ -1382,7 +1382,9 @@ var gErrorsPage = {
var errorReason = document.getElementById("errorReason");
errorReason.value = gUpdates.update.statusText;
var manualURL = getPref("getCharPref", PREF_UPDATE_MANUAL_URL, "");
var formatter = Components.classes["@mozilla.org/browser/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var manualURL = formatter.formatURLPref(PREF_UPDATE_MANUAL_URL, null);
var errorLinkLabel = document.getElementById("errorLinkLabel");
errorLinkLabel.value = manualURL;
errorLinkLabel.href = manualURL;

View File

@ -790,8 +790,9 @@ Update.prototype = {
try {
// Try using a default details URL supplied by the distribution
// if the update XML does not supply one.
return gPref.getComplexValue(PREF_APP_UPDATE_URL_DETAILS,
nsIPrefLocalizedString).data;
var formatter = Components.classes["@mozilla.org/browser/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
return formatter.formatURLPref(PREF_APP_UPDATE_URL_DETAILS, null);
}
catch (e) {
}