From d282184f34b182f1654ce8a823cfe531c54810f5 Mon Sep 17 00:00:00 2001 From: Bill McCloskey Date: Wed, 10 Sep 2014 17:15:40 -0700 Subject: [PATCH] Bug 1057663 - Make sure content process crashes always get reported (r=felipe) --- browser/base/content/aboutTabCrashed.js | 4 ++++ browser/base/content/browser.js | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/browser/base/content/aboutTabCrashed.js b/browser/base/content/aboutTabCrashed.js index 43a807b57fb9..b367be251eca 100644 --- a/browser/base/content/aboutTabCrashed.js +++ b/browser/base/content/aboutTabCrashed.js @@ -11,3 +11,7 @@ function parseQueryString() { } document.title = parseQueryString(); + +// Error pages are loaded as LOAD_BACKGROUND, so they don't get load events. +var event = new CustomEvent("AboutTabCrashedLoad", {bubbles:true}); +document.dispatchEvent(event); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 0c7be40bdb7d..fd8208de3769 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1017,6 +1017,12 @@ var gBrowserInit = { } }); + gBrowser.addEventListener("AboutTabCrashedLoad", function(event) { +#ifdef MOZ_CRASHREPORTER + TabCrashReporter.onAboutTabCrashedLoad(gBrowser.getBrowserForDocument(event.target)); +#endif + }, false, true); + if (uriToLoad && uriToLoad != "about:blank") { if (uriToLoad instanceof Ci.nsISupportsArray) { let count = uriToLoad.Count(); @@ -4044,11 +4050,6 @@ var TabsProgressListener = { if (event.target.documentElement) event.target.documentElement.removeAttribute("hasBrowserHandlers"); }, true); - -#ifdef MOZ_CRASHREPORTER - if (doc.documentURI.startsWith("about:tabcrashed")) - TabCrashReporter.onAboutTabCrashedLoad(aBrowser); -#endif } },