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 {
180
180
return browser ;
181
181
}
182
182
183
+ // Create the profile. We need to run FF to do its setup, then close it & edit more ourselves.
183
184
async setupFirefoxProfile ( ) {
184
185
const messageServer = new MessageServer (
185
186
this . config ,
@@ -279,11 +280,17 @@ export class FreshFirefox implements Interceptor {
279
280
} ) ;
280
281
281
282
browsers [ proxyPort ] = browser ;
282
- browser . process . once ( 'close' , ( exitCode ) => {
283
+ browser . process . once ( 'close' , async ( exitCode ) => {
283
284
console . log ( 'Firefox closed' ) ;
285
+ delete browsers [ proxyPort ] ;
284
286
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 ) ;
285
292
certCheckServer . stop ( ) ;
286
- delete browsers [ proxyPort ] ;
293
+
287
294
if ( ! certCheckSuccessful ) {
288
295
reportError ( `Firefox certificate check ${
289
296
certCheckSuccessful === false
You can’t perform that action at this time.
0 commit comments