Bug 1231518. Load about:blank if thumbnail service fails. r=adw

This commit is contained in:
Mason Chang 2016-01-04 16:24:58 -08:00
parent c9b006d167
commit 6bad741446
2 changed files with 7 additions and 2 deletions

View File

@ -187,6 +187,7 @@ this.PageThumbUtils = {
// remove the scrollbar sizes.
let scale = Math.min(Math.max(intermediateWidth / contentWidth,
intermediateHeight / contentHeight), 1);
let snapshotCtx = snapshotCanvas.getContext("2d");
snapshotCtx.save();
snapshotCtx.scale(scale, scale);

View File

@ -99,7 +99,7 @@ const backgroundPageThumbsContent = {
onStateChange: function (webProgress, req, flags, status) {
if (webProgress.isTopLevel &&
(flags & Ci.nsIWebProgressListener.STATE_STOP) &&
this._currentCapture && Components.isSuccessCode(status)) {
this._currentCapture) {
if (req.name == "about:blank") {
if (this._state == STATE_CAPTURING) {
// about:blank has loaded, ending the current capture.
@ -114,10 +114,14 @@ const backgroundPageThumbsContent = {
this._startNextCapture();
}
}
else if (this._state == STATE_LOADING) {
else if (this._state == STATE_LOADING &&
Components.isSuccessCode(status)) {
// The requested page has loaded. Capture it.
this._state = STATE_CAPTURING;
this._captureCurrentPage();
} else {
this._state = STATE_CANCELED;
this._loadAboutBlank();
}
}
},