Why are Firefox headful runs on Ubuntu flaky in Puppeteer?
PuppeteerSummary
The startup hang in headful mode on Ubuntu was caused by the Firefox Backup Service during startup. A practical workaround is to disable the Backup Service by setting the Firefox preference browser.backup.enabled to false.
Workaround options
Use a Firefox profile with the preference set in user.js:
// firefox profile file: user.js
user_pref("browser.backup.enabled", false);
Pass the preference directly when launching via Puppeteer. The exact option name depends on the Puppeteer version:
const browser = await puppeteer.launch({
product: 'firefox',
headless: false,
firefoxUserPrefs: {
'browser.backup.enabled': false,
},
});
const browser = await puppeteer.launch({
product: 'firefox',
headless: false,
extraPrefsFirefox: {
'browser.backup.enabled': false,
},
});
Notes
- This is a targeted workaround for startup hangs observed in headful Firefox on Linux runners.
- A broader long-term fix involved disabling the backup service in Firefox builds, but setting the preference per profile or per launch is the fastest practical fix.
- If you are not using a custom profile, creating one with user.js and pointing Firefox to it is usually the most reliable path.