mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 961360 - Try again on the about:tabcrashed page should reload all crashed tabs. r=felipe
This commit is contained in:
parent
f9be1f3140
commit
803d770712
@ -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();
|
||||
|
@ -2421,7 +2421,8 @@ let BrowserOnClick = {
|
||||
TabCrashReporter.submitCrashReport(browser);
|
||||
}
|
||||
#endif
|
||||
openUILinkIn(button.getAttribute("url"), "current");
|
||||
|
||||
TabCrashReporter.reloadCrashedTabs();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user