diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm index 951daa0c4b6c..7af10e9d5ead 100644 --- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm +++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm @@ -229,8 +229,16 @@ const BackgroundPageThumbs = { // "resetting" the capture requires more work - so for now, we just // discard it. if (curCapture && curCapture.pending) { - curCapture._done(null, TEL_CAPTURE_DONE_CRASHED); - // _done automatically continues queue processing. + // Continue queue processing by calling curCapture._done(). Do it after + // this crashed listener returns, though. A new browser will be created + // immediately (on the same stack as the _done call stack) if there are + // any more queued-up captures, and that seems to mess up the new + // browser's message manager if it happens on the same stack as the + // listener. Trying to send a message to the manager in that case + // throws NS_ERROR_NOT_INITIALIZED. + Services.tm.currentThread.dispatch(() => { + curCapture._done(null, TEL_CAPTURE_DONE_CRASHED); + }, Ci.nsIEventTarget.DISPATCH_NORMAL); } // else: we must have been idle and not currently doing a capture (eg, // maybe a GC or similar crashed) - so there's no need to attempt a diff --git a/toolkit/components/thumbnails/test/browser.ini b/toolkit/components/thumbnails/test/browser.ini index 3b4ba8931d24..1b6d02f66597 100644 --- a/toolkit/components/thumbnails/test/browser.ini +++ b/toolkit/components/thumbnails/test/browser.ini @@ -12,7 +12,7 @@ support-files = [browser_thumbnails_bg_bad_url.js] [browser_thumbnails_bg_crash_during_capture.js] -skip-if = buildapp == 'mulet' || !crashreporter || e10s # crashing the remote thumbnailer crashes the remote test tab +skip-if = buildapp == 'mulet' || !crashreporter [browser_thumbnails_bg_crash_while_idle.js] skip-if = buildapp == 'mulet' || !crashreporter [browser_thumbnails_bg_basic.js]