Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

using --profile doesn't re-use prefs, for complex reasons. #577

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gregglind
Copy link

Claim:

  1. expect --profile (copy or otherwise) to start with same user.js
  2. MAYBE the jpm prefs should override? I dunno

What happens:

  1. We end up with the default set from firefox-profile package, which is not what we want.

Why:

  • new FirefoxProfile(aPath) creates a profile not using the existing prefs.

I am open to ideas about what the 'right' behaviour should be.

Easy fix, once we decide.

(Fwiw, firefox-profile 0.4.0, the next in the series, changes the new FirefoxProfile interface and is ALSO buggy / wrong when cloning. BE WARNED)

Looking at re-use, it looks like it wants the 0.4.0 firefox-profile interface.

Maybe this needs a bigger re-visit?
@kumar303
Copy link
Contributor

kumar303 commented Sep 1, 2016

Can you explain your use case here? If you're already copying an existing profile, why don't you just put the preferences you need from user.js into the custom profile before you copy it?

@gregglind
Copy link
Author

gregglind commented Sep 1, 2016

Use case:

  • for Shield Studies, we need to do QA testing for some obscure things:
    • making sure orientation only happens in certain branches, and only during install or uninstall
    • setting a bunch of state before startup (--prefs works, but could be awesomer, I have ideas!)
    • other sorts of complicated ui that might involve checking what extensions a user has, etc.

Ideally we also have tests, but this is the sort of stuff where manual verification and faffing about is easier in a FIrefox.

Desired solution

I want this work flow to work trivially.

  1. create an empty profile from the command line that has
  • useful sdk and debugging prefs
  • extended with any prefs of interest from the user
  1. be able to re-use this profile
  • by cloning (cp -rp is acceptable)
  • 'with modification'

jpm could solve this lots of ways:

  1. jpm make-profile -d somedir --prefs some.flie AND jpm run --profile ./somedir --prefs some.json --no-copy all have to work right. :) I am not sure what WORK RIGHT even is, to be honest :) Right now, some parts of that don't work.

It might be nice to bring back the --extensions from cfx

  1. We could have a better profile creation and modificaiton tool, starting from firefox-profile that has all sorts of useful subcommands?
  • mod prefs
  • add extensions
  • localStore some things
  • fill places.db
  1. Simplest might be to

I have been working on my own shield-studies CLI to do this automated setup and running to wrap JPM, but it's been a challenge. I am way deeper in firefox-profile than I had hoped!

@kumar303
Copy link
Contributor

kumar303 commented Sep 2, 2016

Yeah, I feel like creating a new tool that automates the creation of a profile and populates it with the values you need is a better way to go here. The jpm codebase is crufty, full of surprises, and poorly tested. That makes it hard to introduce new features like this.

I'm not really opposed to this patch technically (although it will need test coverage). It just feels like something you could do more easily by writing a standalone script that merges a custom profile with user.js to create a new profile. You could then start up jpm with that new profile.

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

Successfully merging this pull request may close these issues.

2 participants