Bug 961360 - Try again on the about:tabcrashed page should reload all crashed tabs. r=felipe

This commit is contained in:
Tom Schuster 2014-05-29 21:55:44 +02:00
parent f9be1f3140
commit 803d770712
3 changed files with 26 additions and 10 deletions

View File

@ -6,15 +6,8 @@ function parseQueryString() {
let url = document.documentURI;
let queryString = url.replace(/^about:tabcrashed?e=tabcrashed/, "");
let urlMatch = queryString.match(/u=([^&]+)/);
let url = urlMatch && urlMatch[1] ? decodeURIComponent(urlMatch[1]) : "";
let titleMatch = queryString.match(/d=([^&]*)/);
title = titleMatch && titleMatch[1] ? decodeURIComponent(titleMatch[1]) : "";
return [url, title];
return titleMatch && titleMatch[1] ? decodeURIComponent(titleMatch[1]) : "";
}
let [url, title] = parseQueryString();
document.title = title;
document.getElementById("tryAgain").setAttribute("url", url);
document.title = parseQueryString();

View File

@ -2421,7 +2421,8 @@ let BrowserOnClick = {
TabCrashReporter.submitCrashReport(browser);
}
#endif
openUILinkIn(button.getAttribute("url"), "current");
TabCrashReporter.reloadCrashedTabs();
}
},

View File

@ -63,6 +63,28 @@ this.TabCrashReporter = {
}
},
reloadCrashedTabs: function () {
let enumerator = Services.wm.getEnumerator("navigator:browser");
while (enumerator.hasMoreElements()) {
let window = enumerator.getNext();
if (!window.gMultiProcessBrowser)
continue;
for (let browser of window.gBrowser.browsers) {
if (browser.isRemoteBrowser)
continue;
let doc = browser.contentDocument;
if (!doc.documentURI.startsWith("about:tabcrashed"))
continue;
let url = browser.currentURI.spec;
window.gBrowser.updateBrowserRemoteness(browser, url);
browser.loadURIWithFlags(url, Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
}
}
},
onAboutTabCrashedLoad: function (aBrowser) {
if (!this.childMap)
return;