Skip to content

Commit bae202f

Browse files
committed
Fix race condition that might affect firefox startup
Definitely causes reliable test failures. Seems to be a change in Firefox itself, rather than anything on our end.
1 parent 1fd3ed3 commit bae202f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/interceptors/fresh-firefox.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ export class FreshFirefox implements Interceptor {
4848
await certCheckServer.start('https://amiusing.httptoolkit.tech');
4949

5050
const firefoxProfile = path.join(this.config.configPath, 'firefox-profile');
51+
const firefoxPrefsFile = path.join(firefoxProfile, 'prefs.js');
5152

52-
let existingPrefs: _.Dictionary<any> = {}
53+
let existingPrefs: _.Dictionary<any> = {};
5354

54-
if (await canAccess(firefoxProfile)) {
55+
if (await canAccess(firefoxPrefsFile)) {
5556
// If the profile exists, then we've run this before and not deleted the profile,
56-
// so it probably worked. If so, reuse the existing preferences to avoids issues
57+
// so it probably worked. If so, reuse the existing preferences to avoid issues
5758
// where on pref setup firefox behaves badly (opening a 2nd window) on OSX.
58-
const prefContents = await readFile(path.join(firefoxProfile, 'prefs.js'), {
59+
const prefContents = await readFile(firefoxPrefsFile, {
5960
encoding: 'utf8'
6061
});
6162

0 commit comments

Comments
 (0)