Headless chrome does not use correct locale for Date.prototype.toLocaleDateString()
Reported by
hoe...@hsac.nl,
Aug 14 2017
|
|||||
Issue descriptionChrome Version : 60.0.3112.101 I'm using Selenium to drive headless chrome (from Java on macOS), and I see a difference in the locale used as the system default between 'normal' and headless chrome. (1) Open any URL using 'normal' chrome (3) execute `return (new Date(2018, 8, 27)).toLocaleDateString()`, I get '27/09/2018' (1) Open same URL using 'headless' chrome (2) execute `return (new Date(2018, 8, 27)).toLocaleDateString()`, I get '9/27/2018' Is this intentional, can I set the locale used by headless chrome in some way?
,
Aug 15 2017
,
Aug 15 2017
,
Aug 18 2017
The issue seems to be related to selenium driving headless chrome and it is out of TE-scope . Hence, adding labelTE-NeedsTriageHelp for further investigation. Thanks...!!
,
Aug 18 2017
,
Feb 12 2018
I'm also seeing this kind of issue with Headless Chrome being driven by Puppeteer: https://github.com/GoogleChrome/puppeteer/issues/1871.
,
Feb 12 2018
I don't think this is related to Selenium. On mac, when I set my system lang to `en-GB` and examine `navigator.language`, headless doesn't take the system's lang prefs into account: Headless chrome: navigator.languages === 'en-US' navigator.languages === ['en-US'] Headful chrome: navigator.languages === 'en-GB' navigator.languages === ['en-GB', 'en-US', 'en']
,
Oct 12
A workaround that may work for your use case is passing the --lang=<locale> parameter. This didn't seem to change the local on the 'normal' Chrome but led for locale to be detected properly for 'headless' Chrome. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by pauljensen@chromium.org
, Aug 15 2017