iris_firefox icon indicating copy to clipboard operation
iris_firefox copied to clipboard

Can't change Firefox preferences of type Boolean

Open mwobensmith opened this issue 6 years ago • 7 comments

You can set a preference to a Boolean value, but it only works on new prefs. It can't change the value of an existing Firefox pref.

e.g.

preferences={'app.normandy.first_run': True, 'app.normandy.first_run1': True }

Result in prefs.js:

user_pref("app.normandy.first_run", false);
user_pref("app.normandy.first_run1", true);

(Migrated from here.)

mwobensmith avatar Aug 06 '19 19:08 mwobensmith

Needs more investigation. Not sure if the issue is as above, or if Fx is overwriting whatever we set.

mwobensmith avatar Aug 06 '19 19:08 mwobensmith

How does mozrunner successfully make all the settings it applies stick?

tracywalker avatar Aug 06 '19 22:08 tracywalker

Actually, I'm not sure that we have proven a bug in Iris or mozprofile here. The mechanism that mozprofile uses adds entries to the user.js file in the profile. We can see that part is working just by opening that file. However, upon opening prefs.js - which is written back to disk by Firefox after startup - we see that some values don't "stick," but that only represents the state of Firefox when it quit.

Give me an example of a Boolean pref that you need to work on one of the tests. We can run this manually by adding it to an empty profile's user.js file. Then, we can examine the outcome and see if Firefox respected the value, and/or wrote it to prefs.js. If it doesn't work at all, then that could be a Firefox bug.

mwobensmith avatar Aug 12 '19 23:08 mwobensmith

browser.search.widget.inNavBar = true is a config that would be useful in many of the search tests. As of now, tests are setting this through the about:config UI.

tracywalker avatar Aug 13 '19 17:08 tracywalker

I tried adding this to user.js like so:

user_pref("browser.search.widget.inNavBar", true);

But when Firefox opened and I checked about:config, it was still set to false. So, it appears that there are things we cannot set in a profile before launching Firefox. This appears to be a Firefox issue. Would be worth searching Bugzilla to see if it's known.

mwobensmith avatar Aug 13 '19 21:08 mwobensmith

See https://bugzilla.mozilla.org/show_bug.cgi?id=1543752 . There is discussion about what is going on with these files.

tracywalker avatar Aug 14 '19 14:08 tracywalker

This looks bad for us. I imagine other people rely on mozprofile and would be affected by this change.

mwobensmith avatar Aug 14 '19 16:08 mwobensmith