mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 779680 - about:neterror's GoOnline() should be invoked from events, not nsDOMWindowUtils. r=bz,dolske
This commit is contained in:
parent
8f541ca7c2
commit
7a29a9894a
@ -2515,6 +2515,9 @@ let BrowserOnClick = {
|
||||
else if (/^about:blocked/.test(ownerDoc.documentURI)) {
|
||||
this.onAboutBlocked(originalTarget, ownerDoc);
|
||||
}
|
||||
else if (/^about:neterror/.test(ownerDoc.documentURI)) {
|
||||
this.onAboutNetError(originalTarget, ownerDoc);
|
||||
}
|
||||
else if (/^about:home$/i.test(ownerDoc.documentURI)) {
|
||||
this.onAboutHome(originalTarget, ownerDoc);
|
||||
}
|
||||
@ -2681,6 +2684,13 @@ let BrowserOnClick = {
|
||||
notification.persistence = -1;
|
||||
},
|
||||
|
||||
onAboutNetError: function BrowserOnClick_onAboutNetError(aTargetElm, aOwnerDoc) {
|
||||
let elmId = aTargetElm.getAttribute("id");
|
||||
if (elmId != "errorTryAgain" || !/e=netOffline/.test(aOwnerDoc.documentURI))
|
||||
return;
|
||||
Services.io.offline = false;
|
||||
},
|
||||
|
||||
onAboutHome: function BrowserOnClick_onAboutHome(aTargetElm, aOwnerDoc) {
|
||||
let elmId = aTargetElm.getAttribute("id");
|
||||
|
||||
@ -4476,11 +4486,11 @@ var TabsProgressListener = {
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
|
||||
Components.isSuccessCode(aStatus) &&
|
||||
/^about:/.test(aWebProgress.DOMWindow.document.documentURI)) {
|
||||
aBrowser.addEventListener("click", BrowserOnClick, false);
|
||||
aBrowser.addEventListener("click", BrowserOnClick, true);
|
||||
aBrowser.addEventListener("pagehide", function onPageHide(event) {
|
||||
if (event.target.defaultView.frameElement)
|
||||
return;
|
||||
aBrowser.removeEventListener("click", BrowserOnClick, false);
|
||||
aBrowser.removeEventListener("click", BrowserOnClick, true);
|
||||
aBrowser.removeEventListener("pagehide", onPageHide, true);
|
||||
}, true);
|
||||
|
||||
|
@ -75,12 +75,8 @@
|
||||
|
||||
function retryThis(buttonEl)
|
||||
{
|
||||
// If this is the "Offline mode" page, go online!
|
||||
if (getErrorCode() == "netOffline") {
|
||||
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIDOMWindowUtils)
|
||||
.goOnline();
|
||||
}
|
||||
// Note: The application may wish to handle switching off "offline mode"
|
||||
// before this event handler runs, but using a capturing event handler.
|
||||
|
||||
// Session history has the URL of the page that failed
|
||||
// to load, not the one of the error page. So, just call
|
||||
|
Loading…
Reference in New Issue
Block a user