Bug 1287178 - Don't prompt to submit crash reports if user has disabled crash submission in preferences. r?mconley
MozReview-Commit-ID: F8w5NByt4H9
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -127,16 +127,19 @@ XPCOMUtils.defineLazyModuleGetter(this,
"resource:///modules/ContentCrashHandlers.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
if (AppConstants.MOZ_CRASHREPORTER) {
XPCOMUtils.defineLazyModuleGetter(this, "PluginCrashReporter",
"resource:///modules/ContentCrashHandlers.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CrashSubmit",
"resource://gre/modules/CrashSubmit.jsm");
+ XPCOMUtils.defineLazyServiceGetter(this, "CrashReporter",
+ "@mozilla.org/xre/app-info;1",
+ "nsICrashReporter");
}
XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
return Services.strings.createBundle('chrome://branding/locale/brand.properties');
});
XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
return Services.strings.createBundle('chrome://browser/locale/browser.properties');
@@ -846,16 +849,19 @@ BrowserGlue.prototype = {
}
}
},
checkForPendingCrashReports: function() {
// We don't process crash reports older than 28 days, so don't bother submitting them
const PENDING_CRASH_REPORT_DAYS = 28;
if (AppConstants.MOZ_CRASHREPORTER) {
+ if (!CrashReporter.enabled || !CrashReporter.submitReports) {
+ return;
+ }
let dateLimit = new Date();
dateLimit.setDate(dateLimit.getDate() - PENDING_CRASH_REPORT_DAYS);
CrashSubmit.pendingIDsAsync(dateLimit).then(
function onSuccess(ids) {
let count = ids.length;
if (count) {
let win = RecentWindow.getMostRecentBrowserWindow();
let nb = win.document.getElementById("global-notificationbox");