mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 899348 - Make reload of the about:tabcrashed work as expected. r=jaws
This commit is contained in:
parent
36cd1dcd38
commit
dfa23284a3
@ -2341,6 +2341,9 @@ let BrowserOnClick = {
|
||||
ownerDoc.documentURI.toLowerCase() == "about:newtab") {
|
||||
this.onE10sAboutNewTab(aEvent, ownerDoc);
|
||||
}
|
||||
else if (ownerDoc.documentURI.startsWith("about:tabcrashed")) {
|
||||
this.onAboutTabCrashed(aEvent, ownerDoc);
|
||||
}
|
||||
},
|
||||
|
||||
onAboutCertError: function BrowserOnClick_onAboutCertError(aTargetElm, aOwnerDoc) {
|
||||
@ -2473,6 +2476,22 @@ let BrowserOnClick = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* The about:tabcrashed can't do window.reload() because that
|
||||
* would reload the page but not use a remote browser.
|
||||
*/
|
||||
onAboutTabCrashed: function(aEvent, aOwnerDoc) {
|
||||
let isTopFrame = (aOwnerDoc.defaultView.parent === aOwnerDoc.defaultView);
|
||||
if (!isTopFrame) {
|
||||
return;
|
||||
}
|
||||
|
||||
let button = aEvent.originalTarget;
|
||||
if (button.id == "tryAgain") {
|
||||
openUILinkIn(button.getAttribute("url"), "current");
|
||||
}
|
||||
},
|
||||
|
||||
ignoreWarningButton: function BrowserOnClick_ignoreWarningButton(aIsMalware) {
|
||||
// Allow users to override and continue through to the site,
|
||||
// but add a notify bar as a reminder, so that they don't lose
|
||||
@ -2582,6 +2601,16 @@ function getWebNavigation()
|
||||
}
|
||||
|
||||
function BrowserReloadWithFlags(reloadFlags) {
|
||||
let url = gBrowser.currentURI.spec;
|
||||
if (gBrowser._updateBrowserRemoteness(gBrowser.selectedBrowser,
|
||||
gBrowser._shouldBrowserBeRemote(url))) {
|
||||
// If the remoteness has changed, the new browser doesn't have any
|
||||
// information of what was loaded before, so we need to load the previous
|
||||
// URL again.
|
||||
gBrowser.loadURIWithFlags(url, reloadFlags);
|
||||
return;
|
||||
}
|
||||
|
||||
/* First, we'll try to use the session history object to reload so
|
||||
* that framesets are handled properly. If we're in a special
|
||||
* window (such as view-source) that has no session history, fall
|
||||
|
@ -1317,7 +1317,7 @@
|
||||
<![CDATA[
|
||||
let isRemote = aBrowser.getAttribute("remote") == "true";
|
||||
if (isRemote == aRemote)
|
||||
return;
|
||||
return false;
|
||||
|
||||
// Unhook our progress listener.
|
||||
let tab = this._getTabForBrowser(aBrowser);
|
||||
@ -1338,6 +1338,8 @@
|
||||
tab.setAttribute("remote", "true");
|
||||
else
|
||||
tab.removeAttribute("remote");
|
||||
|
||||
return true;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
Loading…
Reference in New Issue
Block a user