<div dir="ltr"><div>Thanks for pushing this through Brian!</div><div><br></div><div>In terms of the config file, you can also point $MACHRC at it, or pass it in via the global --settings mach argument.</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 31, 2017 at 12:50 PM Brian Grinstead <<a href="mailto:bgrinstead@mozilla.com">bgrinstead@mozilla.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">FYI we landed some changes to `./mach run` as a result of this discussion (in bug 1172574). These changes only affect the scratch_user, the profile created if -P or -profile aren’t passed.<br>
<br>
1) The default browser check is disabled by default<br>
2) The about:config warning is disabled by default<br>
3) You can set arbitrary prefs through the CLI using --setpref or through your mach configuration file [0] at ~/.mozbuild/machrc. You can see more details by doing `./mach help run`<br>
<br>
Here's an example command using setpref:<br>
<br>
  ./mach run --setpref browser.startup.homepage="about:config" --setpref devtools.theme=dark<br>
<br>
And here’s an example ~/.mozbuild/machrc file that would revert (1) and (2) for all calls to `./mach run`<br>
<br>
  [runprefs]<br>
  browser.shell.checkDefaultBrowser=true<br>
  general.warnOnAboutConfig=true<br>
<br>
It'd be possible to expand these changes to work with -P and -profile, but we’d have to decide on the expected side effects from doing so (i.e. should the preference changes stick or be reset after the browser closes?).<br>
<br>
Brian<br>
<br>
> On Jul 27, 2017, at 3:37 PM, Brian Grinstead <<a href="mailto:bgrinstead@mozilla.com" target="_blank">bgrinstead@mozilla.com</a>> wrote:<br>
><br>
><br>
>> On Jul 27, 2017, at 9:30 AM, Gregory Szorc <<a href="mailto:gszorc@mozilla.com" target="_blank">gszorc@mozilla.com</a>> wrote:<br>
>>> On Jul 27, 2017, at 07:36, Brian Grinstead <<a href="mailto:bgrinstead@mozilla.com" target="_blank">bgrinstead@mozilla.com</a>> wrote:<br>
>>><br>
>>><br>
>>>> On Jul 26, 2017, at 12:35 PM, Ehsan Akhgari <<a href="mailto:ehsan.akhgari@gmail.com" target="_blank">ehsan.akhgari@gmail.com</a>> wrote:<br>
>>>> Unpopular opinion: I don't think this is a good idea.  The code involved in checking whether we are the default browser has had performance issues (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1357146" rel="noreferrer" target="_blank">https://bugzilla.mozilla.org/show_bug.cgi?id=1357146</a>) and is in my humble opinion not so nice behavior which we've wanted to fix (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1143116" rel="noreferrer" target="_blank">https://bugzilla.mozilla.org/show_bug.cgi?id=1143116</a>) for all users.  Hiding this from our developers seems like a disservice to our users, especially to the new users who we are hoping to attract to Firefox as we are working on improving the browser.<br>
>>><br>
>>> I agree about this for most features. But with the default browser prompt, I don't think improvements for our users align with improvements for our developers. The change that would make the prompt better for me is if it wasn't modal, because then I could ignore it. I don't have any reason to believe that would be an improvement for users, though.<br>
>>><br>
>>>> I understand the desire to do the easy thing and put a band-aid on where we are bleeding for now, but perhaps we should at least consider this as a reminder to check back with the right folks working on the original effort to fix this properly for all users?<br>
>>><br>
>>> Maybe I’m misreading the bug, but we already don’t show the prompt on the first run (via the browser.shell.skipDefaultBrowserCheckOnFirstRun pref). I see the prompt on subsequent runs: so `./mach run --profile /tmp/foo` (no prompt), close browser, `./mach run --profile /tmp/foo` (prompt).<br>
>><br>
>> We have machrc config files. IMO mach should do the most reasonable thing for the majority of developers by default. Minority and edge use cases can be dealt with through config files escape hatches. If we need to establish "profiles" to encapsulate sets of common configs to appease large factions, so be it.<br>
>><br>
>> I suspect this startup prompt falls into "annoying for majority" and/or "relevant to minority" so I think disabling by default makes sense.<br>
>><br>
>> Also, IIRC there is no way to set single prefs from a Firefox CLI argument. 'mach run' doesn't yet involve itself heavily in profile management: it just creates an empty directory for a temp profile. It feels unfortunate we have to muck around with profiles to accomplish this simple task. But if it is just writing a user.js file in an empty to-be-profile directory, that does seem too bad. Still, it would be nice to have something more formal on the CLI, as our prevailing convention of environment variables lends itself to poor documentation, poor discovery, makes us susceptible to conflicts with other programs' use of environment variables, and may even open us up to security issues like the HTTPoxy class of vulnerabilities.<br>
><br>
> OK, it seems like there are a few paths forward for changing default pref values:<br>
><br>
> 1) A combination of !MOZ_OFFICIAL and a sticky_pref with a different default. This means local builds will get the default without mach, and that you can share a dev profile bewteen Nightly and a local build while getting different default behavior in each. This is what we are doing for the Browser Toolbox prefs.<br>
> 2) Do something like Bug 1172574, where we could specify a default set of prefs for scratch_user profiles created by mach. It would only affect `mach run`. It doesn't work when sharing a profile between Nightly and a local build.<br>
> 3) Add a new CLI argument for Firefox that lets you set prefs. This does allow for sharing a dev profile between Nightly and a local build, but with what may be undesirable behavior (the pref would remain set to the 'local build' value even when opening in Nightly).<br>
><br>
> For the small set of prefs like this (and the about:config warning) that we'd consider flipping for all local builds, I still think (1) is the best option since it still allows for the 'sharing a profile between local and Nightly' workflow. But if we wanted to focus just on the 'mach run with the scratch_user’ experience (2) could work just as well. Also, (2) seems really useful generally since it'd let people change whatever prefs suit them (either via mach run CLI argument or a mach config).<br>
><br>
> Brian<br>
><br>
<br>
_______________________________________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org" target="_blank">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank">https://mail.mozilla.org/listinfo/firefox-dev</a><br>
</blockquote></div>