Brian
_______________________________________________
firefox-dev mailing list
firef...@mozilla.org
https://mail.mozilla.org/listinfo/firefox-dev
Brian
Please yes. This is one of my biggest development pet peeves...
It would really be nice to have `mach run` accept the --setpref
flag, like other mach commands. But an environment variable
should be sufficient.
>> On Jul 26, 2017, at 11:06 AM, Ryan VanderMeulen <rvande...@mozilla.com> wrote:
>>
>> This is using |mach run| I assume? I would think we could certainly make that the default under those circumstances, yes, but I'd hesitate to do so unconditionally for local builds otherwise.
>>
>> -Ryan
>>
>> On Wed, Jul 26, 2017 at 2:03 PM, Brian Grinstead <bgrin...@mozilla.com> wrote:
>> There’s a modal prompt that opens on startup after every clobber asking me if I want to set the local build as my default browser (I don’t). Are there any objections to defaulting browser.shell.checkDefaultBrowser to false in local builds? We already do this for tests.
>>
>> Brian
>> _______________________________________________
>> firefox-dev mailing list
>> firef...@mozilla.org
>> https://mail.mozilla.org/listinfo/firefox-dev
>>
>
>_______________________________________________
>firefox-dev mailing list
>firef...@mozilla.org
>https://mail.mozilla.org/listinfo/firefox-dev
--
Kris Maglione
Senior Firefox Add-ons Engineer
Mozilla Corporation
Simple things should be simple. Complex things should be possible.
--Alan Kay
Brian
I was hoping to not rely on an environment variable for cases like these since I assumed it would imply doing either:
1) Change all places that access the pref to also look for an environment variable and bypass the pref value.
2) Run some code during startup based on the environment variable that changes the default values of relevant prefs (which adds yet another place where default prefs are defined).
I agree --setpref would be nice for |mach run| - I guess we'd pass it along as a new command line argument to Firefox (as opposed to in tests where a new profile is created). But an extra note is that in this case we will want to use a sticky_pref to prevent a scenario where you open a profile in Nightly and set browser.shell.checkDefaultBrowser to false, then open the same profile in a local build (which resets it into a default value), then open the same profile again in Nightly (where it is now true again). So I’m not sure if we’d want one command line option for normal prefs and a different one for sticky prefs, or what.
Brian
On Wed, Jul 26, 2017 at 11:03:39AM -0700, Brian Grinstead wrote:
There’s a modal prompt that opens on startup after every clobber asking me if I want to set the local build as my default browser (I don’t). Are there any objections to defaulting browser.shell.checkDefaultBrowser to false in local builds? We already do this for tests.
Please yes. This is one of my biggest development pet peeves...
The issue is that in development builds, we often wind up
repeatedly creating new profiles, particularly after clobber.
Having `mach run` create a user.js file might be a good option,
but there are still plenty of times when I need to change some
particular preference for one or several runs (like I do for
talos or mochitest runs on a regular basis) and being able to
pass an ephemeral value via --setpref would be much more useful.
Brian: would it meet your needs to simply set this pref to false in user.js in your testing profile?(And one way to do that is to have mach run write that to user.js for you… after all, it knows which profile you're using.)
Brian
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.
> 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?
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).
Brian
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.
I suspect this startup prompt falls into "annoying for majority" and/or "relevant to minority" so I think disabling by default makes sense.
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.
> On Jul 26, 2017, at 12:35 PM, Ehsan Akhgari <ehsan....@gmail.com> wrote:
> 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 https://bugzilla.mozilla.org/show_bug.cgi?id=1357146) and is in my humble opinion not so nice behavior which we've wanted to fix (https://bugzilla.mozilla.org/show_bug.cgi?id=1143116) 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.
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.
> 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?
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).
OK, it seems like there are a few paths forward for changing default pref values:
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.
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.
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).
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).
Brian
1) The default browser check is disabled by default
2) The about:config warning is disabled by default
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`
Here's an example command using setpref:
./mach run --setpref browser.startup.homepage="about:config" --setpref devtools.theme=dark
And here’s an example ~/.mozbuild/machrc file that would revert (1) and (2) for all calls to `./mach run`
[runprefs]
browser.shell.checkDefaultBrowser=true
general.warnOnAboutConfig=true
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?).
Brian