Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v18.0.5 broke Firefox pref files #2772

Closed
ferenc-a opened this issue Sep 4, 2024 · 7 comments
Closed

v18.0.5 broke Firefox pref files #2772

ferenc-a opened this issue Sep 4, 2024 · 7 comments

Comments

@ferenc-a
Copy link

ferenc-a commented Sep 4, 2024

I relied on PuppeteerSharp not creating Firefox pref files and creating them manually before launching Firefox. This broke when I updated to v18.0.5. I tracked it down, and it was caused by this this line ( Firefox.CreateProfile() going out of the conditional. I'd need either:

  • An option to opt out from PuppeteerSharp creating these files so that I can go back to the old behaviour.
  • More granular pref file support, so that I can use PuppeteerSharp to set up both my user.js and prefs.js files separately, and override PuppeteerSharps default values, like with IgnoredDefaultArgs
@kblok
Copy link
Member

kblok commented Sep 4, 2024

I think it's related to #2737.
I'll put that next on my list :)
Closing in favor of #2737

@kblok kblok closed this as not planned Won't fix, can't repro, duplicate, stale Sep 4, 2024
@kblok
Copy link
Member

kblok commented Sep 4, 2024

@ferenc-a do you want to test 20.0.1-beta1 before I merge it?

@ferenc-a
Copy link
Author

ferenc-a commented Sep 5, 2024

That'd nice, thanks! I'll take a look at it today, I have the repo cloned anyway.
It's this PR right? #2773
I looked at the code, but I'm not sure about the usage. Is it just that providing a UserDataDir now doesn't overwrite prefs, no changes needed on my end?

Update: Simply updating to the branch and not changing my code didn't solve it. I still needed to comment out the Firefox.CreateProfile( line to get back the old behaviour.

@kblok
Copy link
Member

kblok commented Sep 5, 2024

I just saw what you need. This PR is backing up your old prefs and restoring them when puppeteer closes the browser.
You have options.ExtraPrefsFirefox that will be merged in the user.js file with puppeteer's defaults. Will that help?

@ferenc-a
Copy link
Author

ferenc-a commented Sep 5, 2024

I don't think so. I need to set up both prefs.js and user.js, entirely with my own prefs. Which I'd be happy to do with PuppeteerSharp too. But looking at the current implementation, it looks like prefs.js is alway overridden to be empty. I also don't see how I'd delete or override the values that get applied by GetDefaultPreferences and GetPreferences.

@kblok
Copy link
Member

kblok commented Sep 5, 2024

@ferenc-a what's the setting that we're putting there that's breaking your scenario. Maybe with the right use-case we can request that change in puppeteer.
I won't add any feature that it's not in puppeteer.

@ferenc-a
Copy link
Author

ferenc-a commented Sep 6, 2024

I have tens of custom prefs, and don't really want to start investigating which one breaks the launch. Even if the launch doesn't break, I need all of them overriding Puppeteer defaults, persisting and not be deleted on startup. That is my use case, not any individual pref.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants