diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-04 23:58:35 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-04 23:58:35 +0200 |
commit | de85309fb1db7895b985440a3d998cea726b561a (patch) | |
tree | 198b6cf4efce70d921bc9241d6ff0119e104bb9c /toolkit/components | |
parent | 057bc2ddba93c1170aef58922c2a7beba04d0de2 (diff) | |
download | UXP-de85309fb1db7895b985440a3d998cea726b561a.tar UXP-de85309fb1db7895b985440a3d998cea726b561a.tar.gz UXP-de85309fb1db7895b985440a3d998cea726b561a.tar.lz UXP-de85309fb1db7895b985440a3d998cea726b561a.tar.xz UXP-de85309fb1db7895b985440a3d998cea726b561a.zip |
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.
Diffstat (limited to 'toolkit/components')
-rw-r--r-- | toolkit/components/thumbnails/BackgroundPageThumbs.jsm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm index fded51cea..bd52e77e9 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; } |