mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1247641 - When loading a background thumbnail, load about:blank asynchronously when a load fails to avoid endless redirects. r=markh
This commit is contained in:
parent
22b2841052
commit
4440844edb
@ -108,8 +108,6 @@ const backgroundPageThumbsContent = {
|
||||
this._startNextCapture();
|
||||
}
|
||||
else if (this._state == STATE_CANCELED) {
|
||||
// A capture request was received while the current capture's page
|
||||
// was still loading.
|
||||
delete this._currentCapture;
|
||||
this._startNextCapture();
|
||||
}
|
||||
@ -119,9 +117,20 @@ const backgroundPageThumbsContent = {
|
||||
// The requested page has loaded. Capture it.
|
||||
this._state = STATE_CAPTURING;
|
||||
this._captureCurrentPage();
|
||||
} else {
|
||||
}
|
||||
else if (this._state != STATE_CANCELED) {
|
||||
// Something went wrong. Cancel the capture. Loading about:blank
|
||||
// while onStateChange is still on the stack does not actually stop
|
||||
// the request if it redirects, so do it asyncly.
|
||||
this._state = STATE_CANCELED;
|
||||
if (!this._cancelTimer) {
|
||||
this._cancelTimer =
|
||||
Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this._cancelTimer.init(() => {
|
||||
this._loadAboutBlank();
|
||||
delete this._cancelTimer;
|
||||
}, 0, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user