Bug 1170162: Use a support page for signing warnings intended for users. r=dao

--HG--
extra : commitid : L3inMC9RBcT
extra : rebase_source : 15d39486b95eee5086eef8ad9060a45fe86a5814
This commit is contained in:
Dave Townsend 2015-06-08 09:17:15 -07:00
Родитель 9c04673e97
Коммит 6693a19d53
6 изменённых файлов: 13 добавлений и 12 удалений

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

@ -123,8 +123,7 @@ const gXPInstallObserver = {
}
};
options.learnMoreURL = Services.urlFormatter.formatURLPref("app.support.baseURL") +
"find-and-install-add-ons";
options.learnMoreURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
let messageString;
let notification = document.getElementById("addon-install-confirmation-notification");
@ -132,17 +131,20 @@ const gXPInstallObserver = {
// None of the add-ons are verified
messageString = gNavigatorBundle.getString("addonConfirmInstallUnsigned.message");
notification.setAttribute("warning", "true");
options.learnMoreURL += "unsigned-addons";
}
else if (unsigned.length == 0) {
// All add-ons are verified or don't need to be verified
messageString = gNavigatorBundle.getString("addonConfirmInstall.message");
notification.removeAttribute("warning");
options.learnMoreURL += "find-and-install-add-ons";
}
else {
// Some of the add-ons are unverified, the list of names will indicate
// which
messageString = gNavigatorBundle.getString("addonConfirmInstallSomeUnsigned.message");
notification.setAttribute("warning", "true");
options.learnMoreURL += "unsigned-addons";
}
let brandBundle = document.getElementById("bundle_brand");
@ -310,8 +312,7 @@ const gXPInstallObserver = {
// Add Learn More link when refusing to install an unsigned add-on
if (install.error == AddonManager.ERROR_SIGNEDSTATE_REQUIRED) {
options.learnMoreURL =
Services.prefs.getCharPref("xpinstall.signatures.infoURL");
options.learnMoreURL = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
}
messageString = gNavigatorBundle.getFormattedString(error, args);

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

@ -4297,7 +4297,6 @@ pref("browser.history.maxStateObjectSize", 655360);
pref("xpinstall.whitelist.required", true);
// Only Firefox requires add-on signatures
pref("xpinstall.signatures.required", false);
pref("xpinstall.signatures.infoURL", "https://wiki.mozilla.org/Addons/Extension_Signing");
pref("extensions.alwaysUnpack", false);
pref("extensions.minCompatiblePlatformVersion", "2.0");

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

@ -3147,7 +3147,7 @@ var gDetailView = {
);
var infoLink = document.getElementById("detail-" + msgType + "-link");
infoLink.value = gStrings.ext.GetStringFromName("details.notification.unsigned.link");
infoLink.href = Services.prefs.getCharPref("xpinstall.signatures.infoURL");
infoLink.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
infoLink.hidden = false;
} else if (!this._addon.isCompatible && (AddonManager.checkCompatibility ||
(this._addon.blocklistState != Ci.nsIBlocklistService.STATE_SOFTBLOCKED))) {

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

@ -1257,7 +1257,7 @@
);
let infoLink = this.mAddon.appDisabled ? this._errorLink : this._warningLink;
infoLink.value = gStrings.ext.GetStringFromName("notification.unsigned.link");
infoLink.href = Services.prefs.getCharPref("xpinstall.signatures.infoURL");
infoLink.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
infoLink.hidden = false;
} else if ((!isUpgrade && !this.mAddon.isCompatible) && (AddonManager.checkCompatibility
|| (this.mAddon.blocklistState != Ci.nsIBlocklistService.STATE_SOFTBLOCKED))) {

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

@ -18,6 +18,7 @@ var gVersion = Services.appinfo.version;
var gBlocklistURL = Services.urlFormatter.formatURLPref("extensions.blocklist.detailsURL");
var gPluginURL = Services.urlFormatter.formatURLPref("plugins.update.url");
var gDate = new Date(2010, 7, 1);
let infoURL = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
function open_details(aId, aType, aCallback) {
requestLongerTimeout(2);
@ -712,7 +713,7 @@ add_test(function() {
is(get("detail-warning").textContent, "Test add-on 9 could not be verified for use in " + gApp + ". Proceed with caution.", "Warning message should be correct");
is_element_visible(get("detail-warning-link"), "Warning link should be visible");
is(get("detail-warning-link").value, "More Information", "Warning link text should be correct");
is(get("detail-warning-link").href, Services.prefs.getCharPref("xpinstall.signatures.infoURL"), "Warning link should be correct");
is(get("detail-warning-link").href, infoURL, "Warning link should be correct");
is_element_hidden(get("detail-pending"), "Pending message should be hidden");
run_next_test();
@ -735,7 +736,7 @@ add_test(function() {
is(get("detail-error").textContent, "Test add-on 10 could not be verified for use in " + gApp + " and has been disabled.", "Error message should be correct");
is_element_visible(get("detail-error-link"), "Error link should be visible");
is(get("detail-error-link").value, "More Information", "Error link text should be correct");
is(get("detail-error-link").href, Services.prefs.getCharPref("xpinstall.signatures.infoURL"), "Error link should be correct");
is(get("detail-error-link").href, infoURL, "Error link should be correct");
is_element_hidden(get("detail-pending"), "Pending message should be hidden");
run_next_test();

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

@ -8,7 +8,6 @@ let tempScope = {};
Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", tempScope);
let LightweightThemeManager = tempScope.LightweightThemeManager;
var gProvider;
var gManagerWindow;
var gCategoryUtilities;
@ -18,6 +17,7 @@ var gVersion = Services.appinfo.version;
var gBlocklistURL = Services.urlFormatter.formatURLPref("extensions.blocklist.detailsURL");
var gPluginURL = Services.urlFormatter.formatURLPref("plugins.update.url");
var gDate = new Date(2010, 7, 16);
let infoURL = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
var gLWTheme = {
id: "4",
@ -412,7 +412,7 @@ add_test(function() {
is(get_node(addon, "warning").textContent, "Test add-on 10 could not be verified for use in " + gApp + ". Proceed with caution.", "Warning message should be correct");
is_element_visible(get_node(addon, "warning-link"), "Warning link should be visible");
is(get_node(addon, "warning-link").value, "More Information", "Warning link text should be correct");
is(get_node(addon, "warning-link").href, Services.prefs.getCharPref("xpinstall.signatures.infoURL"), "Warning link should be correct");
is(get_node(addon, "warning-link").href, infoURL, "Warning link should be correct");
is_element_hidden(get_node(addon, "error"), "Error message should be hidden");
is_element_hidden(get_node(addon, "error-link"), "Error link should be hidden");
is_element_hidden(get_node(addon, "pending"), "Pending message should be hidden");
@ -433,7 +433,7 @@ add_test(function() {
is(get_node(addon, "error").textContent, "Test add-on 11 could not be verified for use in " + gApp + " and has been disabled.", "Error message should be correct");
is_element_visible(get_node(addon, "error-link"), "Error link should be visible");
is(get_node(addon, "error-link").value, "More Information", "Error link text should be correct");
is(get_node(addon, "error-link").href, Services.prefs.getCharPref("xpinstall.signatures.infoURL"), "Error link should be correct");
is(get_node(addon, "error-link").href, infoURL, "Error link should be correct");
is_element_hidden(get_node(addon, "pending"), "Pending message should be hidden");
info("Filter for disabled unsigned extensions");