diff --git a/toolkit/components/thumbnails/PageThumbUtils.jsm b/toolkit/components/thumbnails/PageThumbUtils.jsm index 5ff8b5229904..0f3da6f97a15 100644 --- a/toolkit/components/thumbnails/PageThumbUtils.jsm +++ b/toolkit/components/thumbnails/PageThumbUtils.jsm @@ -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); diff --git a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js index dcbc7a81fa45..342847b74975 100644 --- a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js +++ b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js @@ -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(); } } },