Closed Bug 1466829 Opened 6 years ago Closed 6 years ago

inability to set some default localized preferences

Categories

(Firefox :: Enterprise Policies, defect)

60 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jean-sebastien.frenette, Assigned: mkaply)

Details

Attachments

(5 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Build ID: 20180516032417

Steps to reproduce:

Create a .cfg file with the following content:
  "preferences": {
"intl.accept_languages": {
      "value": "fr-ca,fr,fr-fr,en-us,en"
    }
}

(created with CCK2)


Actual results:

When going into the options, the language pane is empty. If I try to add a language, nothing happen and the value isn't change.

Also, when visiting a website, it doesn't send the values and instead send only english. If I open about:config, the value is there. If I change it at this place and add another language, the UI work again and the values are sent.


Expected results:

UI should show the correct language and send them in the header like it used to in 52.4 ESR.
(In reply to jean-sebastien.frenette from comment #0)
> When going into the options, the language pane is empty. If I try to add a
> language, nothing happen and the value isn't change.

Do you mean the Language section of about:preferences#general? Are you adding languages in the configuration file and the changes aren't reflected there after restarting?
Or do you mean the Language category of the Add-ons Manager? The latter only lists language packs for the user interface [1].

Also, what's your Firefox locale (the language of the user interface)?

> Also, when visiting a website, it doesn't send the values and instead send
> only english.

You verified this using the Browser Console request headers?

[1] https://addons.mozilla.org/firefox/language-tools/
[2] https://developer.mozilla.org/docs/Tools/Browser_Console
Component: Untriaged → Enterprise Policies
Hello,

I'm talking about Options ==> General ==> Select language preference for pages ==> Select. This GUI is blank when something is set through a configuration file (like mozilla.cfg). You must reset user preference for this to happen (if the user have preference, it won't work).

My Firefox Local is French, but pages like www.google.ca get showed in english, while my Windows is also in French. When using Firefox 52.4 ESR using the same configuration, the page are in french.

In the console, I see en-US when checking google.ca in incognito mode (so my logins doesn't affect) while it's in french in old version. We also have intranet website that show in english or just doesn't work because we use french language and now, they received bad header.

If I remove the configuration from the config file, the GUI work properly and our internal web page work.
This isn't policy specific, but I'm taking it.

You can recreate it with an autoConfig like this:

defaultPref("intl.accept_languages", "fr-ca,fr,fr-fr,en-us,en");

It only happens if it is a default pref not a user preference.
Assignee: nobody → mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
I remember why now. intl.accept_languages is a localized preference.

That means you have to set the value like this:

data:text/plain,intl.accept_languages=fr-ca,fr,fr-fr,en-us,en

See:

https://mike.kaply.com/2012/08/29/setting-the-default-firefox-homepage-with-autoconfig/

But this is a regression from the preferences XBL binding rewrite, because you used to be able to just set the value and it worked.
Blocks: 1379338
Component: Enterprise Policies → Preferences
Summary: intl.accept_languages not working in FF 60 ESR → scriptifying preferences XBL broke the ability to set some default localized preferences
I just tested Firefox 52 ESR and it has the same behavior, so I'm going to close this.

You have two choices in the CCK2:

1. Use the data:text/plain idea.
2. Set it as a user preference instead of a default preference.

I'll probably add this preference as a policy as well.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
@mkaply: If 52 ESR exhibits the same behavior, then it isn't a regression from bug 1379338 after all, right?
Correct. Forgot to remove the block. Sorry for the churn.
No longer blocks: 1379338
Summary: scriptifying preferences XBL broke the ability to set some default localized preferences → inability to set some default localized preferences
Hello, you say that the same behavior happen with 52.4 ESR, but I can't reproduce with 52.4 ESR. Brand new installation, everything work like it should with the exact same configuration file.

I don't want it as a user pref because it get reset each close, which is something I don't want. If I could I would attach some file but I don't see the option. Don't forget you need to clear your user profile to see the default pref applied.

Right now, I have a Windows 10 Ent 1709 FR open with a brand new installation of Firefox 52.4 ESR Fr. In it, the exact same configuration file. I go into Options ==> Content ==> Languages ==> Select and the GUI show me all 5 languages. When I go to google.ca or an intranet website, I get the french webpage. I don't see why you say it's the same behavior as 52 since I don't have the problem with 52.

Thank you
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Attached image 52.4ESR-1.png
Configuration file, Languages selection GUI and Firefox about. This all work properly in firefox 52.4 ESR
Attached image 52.4ESR-2.png
Google.ca loaded in french by itself
Attached image 60.0.1ESR-1.png
60.0.1 ESR 64-bits with configuration file, GUI showing blank, about window
Attached image 60.0.1ESR-2.png
google.ca loaded in english canada instead of french
When you go to about:config in Firefox 60, what is the intl.accept_languages value set to?

I have code in the CCK2 that should set it to the value:

data:text/plain,intl.accept_languages=fr-ca,fr,fr-fr,en-us,en

Which works.

But in the screenshots you posted to the list, it is just set to:

fr-ca,fr,fr-fr,en-us,en (as a default preference).
It is set to fr-Ça, fr, fr-fr, en-us, en in about:config. If I modify the value to remove or add a language in about config, the Gui work back and the header get sent properly. Thus Google will now give me French web page. Funny thing, I made a different default without fr, it gave me the same bug. I added back with about config fr, it now show me the whole list properly unless I reset to default since it's now in the user pref.

Ill be able to take screenshot tomorrow, I'm out of office.
Ok, just checked about:config and I see what you mean. With the same config file, I have different result. In 60.0.1, it's 

fr-ca,fr,fr-fr,en-us,en

In 52.4, it's "data:text/plain,intl.accept_languages=fr-ca,fr,fr-fr,en-us,en".

But what's weird. In firefox 60, if I modify the value in about config (like, for instance, removing fr so it's now "fr-ca,fr,fr-fr,en-us,en"), the value is properly parsed by the GUI and it's working properly. Samething with 52.4, if I do a change in the GUI, the "data:text/plain,intl.accept_languages=" part is removed.

But the config file work without the "data:text/plain.." part in 52.4.

Thank you
The data:text/plain part is only needed if it is a default preference. Once it is modified (bold in about:config), it's read differently, so it doesn't need that.

As far as working without data:text/plain in 52.4, that wasn't my experience when I set the preference via autoconfig directly (versus using CCK2). And again, the CCK2 has code that always adds the data:text/plain for this preference if it is default:

https://github.com/mkaply/cck2wizard/blob/b7537afe28df546225de27f3cea8c34642b3caff/cck2/modules/CCK2.jsm#L226

So the real question is why the CCK2 isn't adding the data:text/plain in Firefox 60 for you. In my testing it was.
Thats weird because I generated a new CCK2 configuration with the latest version of CCK2, but using 52.4 since it's unsuported by 60.0. Could it be because I repackaged the firefox installation like it's stated on the wiki to do?
Attached file cck2.zip
Here's the config file I'm using
This doesn't look like something that we need to track as part of Firefox's internal preferences work, only as cck2/enterprise-policies stuff.
Component: Preferences → Enterprise Policies
Isn't the cck2.cfg a simple autoconfig file?
> Isn't the cck2.cfg a simple autoconfig file?

No, it's more complex than that. I'm still investigating.
So I finally understand what is going on here.

In Firefox 60, intl.accept_languages is set dynamically (no longer a default preference).

I have code in the CCK that assume intl.accept_languages is a default preference.

Fixing in the CCK2.
https://github.com/mkaply/cck2wizard/pull/87

Marking INVALID since it's a CCK2 problem.
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: