File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ export class FreshFirefox implements Interceptor {
180180 return browser ;
181181 }
182182
183+ // Create the profile. We need to run FF to do its setup, then close it & edit more ourselves.
183184 async setupFirefoxProfile ( ) {
184185 const messageServer = new MessageServer (
185186 this . config ,
@@ -279,11 +280,17 @@ export class FreshFirefox implements Interceptor {
279280 } ) ;
280281
281282 browsers [ proxyPort ] = browser ;
282- browser . process . once ( 'close' , ( exitCode ) => {
283+ browser . process . once ( 'close' , async ( exitCode ) => {
283284 console . log ( 'Firefox closed' ) ;
285+ delete browsers [ proxyPort ] ;
284286
287+ // It seems maybe this can happen when firefox is just updated - it starts and
288+ // closes immediately, but loses some settings along the way. In that case, the 2nd
289+ // run will still try to load the cert check server. Keep it up for a sec so
290+ // that users get a clean error in this case.
291+ await delay ( 2000 ) ;
285292 certCheckServer . stop ( ) ;
286- delete browsers [ proxyPort ] ;
293+
287294 if ( ! certCheckSuccessful ) {
288295 reportError ( `Firefox certificate check ${
289296 certCheckSuccessful === false
You can’t perform that action at this time.
0 commit comments