Bug 787410 - Allow overriding the plugin hang report submission URL via prefs (also allow overriding in general using MOZ_CRASHREPORTER_URL like the standalone client does), r?ted

This commit is contained in:
Benjamin Smedberg 2012-09-11 15:13:00 -04:00
parent 575193173d
commit 76a50aec21

View File

@ -176,10 +176,26 @@ Submitter.prototype = {
return false; return false;
} }
let serverURL = reportData.ServerURL;
delete reportData.ServerURL;
// Override the submission URL from the environment or prefs.
var envOverride = Cc['@mozilla.org/process/environment;1'].
getService(Ci.nsIEnvironment).get("MOZ_CRASHREPORTER_URL");
if (envOverride != '') {
serverURL = envOverride;
}
else if ('PluginHang' in reportData) {
try {
serverURL = Services.prefs.
getCharPref("toolkit.crashreporter.pluginHangSubmitURL");
} catch(e) { }
}
let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Ci.nsIXMLHttpRequest); .createInstance(Ci.nsIXMLHttpRequest);
xhr.open("POST", reportData.ServerURL, true); xhr.open("POST", serverURL, true);
delete reportData.ServerURL;
let formData = Cc["@mozilla.org/files/formdata;1"] let formData = Cc["@mozilla.org/files/formdata;1"]
.createInstance(Ci.nsIDOMFormData); .createInstance(Ci.nsIDOMFormData);