fix(chromium): make locale overrides work (#1108)
This commit is contained in:
parent
3afaeef557
commit
4f69930fbe
|
|
@ -112,6 +112,8 @@ export class CRPage implements PageDelegate {
|
||||||
promises.push(this._client.send('Emulation.setScriptExecutionDisabled', { value: true }));
|
promises.push(this._client.send('Emulation.setScriptExecutionDisabled', { value: true }));
|
||||||
if (options.userAgent || options.locale)
|
if (options.userAgent || options.locale)
|
||||||
promises.push(this._client.send('Emulation.setUserAgentOverride', { userAgent: options.userAgent || '', acceptLanguage: options.locale }));
|
promises.push(this._client.send('Emulation.setUserAgentOverride', { userAgent: options.userAgent || '', acceptLanguage: options.locale }));
|
||||||
|
if (options.locale)
|
||||||
|
promises.push(this._client.send('Emulation.setLocaleOverride', { locale: options.locale }));
|
||||||
if (options.timezoneId)
|
if (options.timezoneId)
|
||||||
promises.push(emulateTimezone(this._client, options.timezoneId));
|
promises.push(emulateTimezone(this._client, options.timezoneId));
|
||||||
if (options.geolocation)
|
if (options.geolocation)
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ module.exports.describe = function({testRunner, expect, playwright, headless, FF
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.skip(CHROMIUM || FFOX)('BrowserContext({locale})', function() {
|
describe.skip(FFOX)('BrowserContext({locale})', function() {
|
||||||
it('should affect accept-language header', async({browser, server}) => {
|
it('should affect accept-language header', async({browser, server}) => {
|
||||||
const context = await browser.newContext({ locale: 'fr-CH' });
|
const context = await browser.newContext({ locale: 'fr-CH' });
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue