From 952c11cef934361a6aae5d08e4bd6b6e687f824c Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 4 Jul 2018 23:58:35 +0200 Subject: [PATCH] On failure, save a dummy file from the background page thumb capture module. If a background page thumbnail capture fails (e.g. due to too heavy scripting), we should write -something- to the thumbnail cache, because otherwise it will try again and again, which is problematic for bad trap pages, that even if the user has left the page never to return again, the thumbnail service may still try to capture, and fail. This resolves the only problem for us in #592. --- toolkit/components/thumbnails/BackgroundPageThumbs.jsm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm index fded51cea1..bd52e77e92 100644 --- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm +++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm @@ -468,7 +468,12 @@ Capture.prototype = { }; if (!data) { - done(); + // If this background attempt failed, cause a dummy file to be saved, so + // that gets loaded instead of attempting again (and again). + // XXX: Perhaps we can create a placeholder image to use instead of "null" + // here, so it has something to show to the user? + PageThumbs._store(this.url, this.url, null, true) + .then(done, done); return; }