Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set Accept-Language at the layer that matches your test. For a wire-level header, add an extra HTTP header. For full locale emulation, configure the browser context or Chrome DevTools Protocol (CDP) language override. In Puppeteer, call page.setExtraHTTPHeaders() before navigation. In Playwright, prefer locale when you also need navigator.language and date/number formatting to change. With CDP, use Network.setUserAgentOverride with acceptLanguage, or Network.setExtraHTTPHeaders for direct header injection.

Choose between a header and a locale

An Accept-Language value tells a server which languages the client prefers. A value such as fr-FR,fr;q=0.9 requests French as the primary preference and generic French as a fallback. The header alone does not necessarily change what JavaScript reports or how the browser formats dates and numbers.

Use this decision rule:

  • Only the HTTP value matters: configure extra HTTP headers in Puppeteer, Playwright, or CDP.
  • The page should behave like a user in a locale: use Playwright’s locale option, or CDP’s browser-language emulation.
  • You need both: set the locale and verify the actual request; add an explicit header only when the exact wire value is required.

These settings affect requests made after they are configured. Apply them before goto() or the first navigation you intend to test.

Playwright: emulate a locale or set only the header

Full locale emulation

Playwright’s browser-context locale option changes three observable areas: navigator.language, the Accept-Language request header, and number/date formatting rules. This is the appropriate choice for tests that represent a user in a particular region.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
import { chromium } from 'playwright';

const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({ locale: 'fr-FR' });
const page = await context.newPage();

await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
console.log(await page.evaluate(() => navigator.language));

await browser.close();

A locale such as en-GB or de-DE represents a language and regional variant. Let Playwright construct the corresponding browser signals when those signals are what your application uses.

Exact header injection

When the test must send a particular string, set extraHTTPHeaders on the context:

import { chromium } from 'playwright';

const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
  extraHTTPHeaders: {
    'Accept-Language': 'fr-FR,fr;q=0.9'
  }
});
const page = await context.newPage();

await page.goto('https://example.com');
await browser.close();

Context-level extra headers apply to requests initiated by pages in that context. If you also configure page-specific headers, the page-level value takes precedence for a header overridden there. Use this narrowly when a protocol- or application-specific string matters more than complete locale behavior.

Playwright validation

const observed = await page.evaluate(() => ({
  language: navigator.language,
  languages: navigator.languages,
  formatted: new Intl.NumberFormat().format(1234567.89),
  date: new Intl.DateTimeFormat().format(new Date('2025-01-15T00:00:00Z'))
}));
console.log(observed);

To verify the wire value, have the test server record request headers or use its request-inspection endpoint. Checking only navigator.language can miss a header-only configuration; checking only the server can miss a locale mismatch in client-side rendering.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer: add the header to every page request

Puppeteer exposes page.setExtraHTTPHeaders(). The headers are sent with every request initiated by that page after the method is called.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();

await page.setExtraHTTPHeaders({
  'Accept-Language': 'fr-FR,fr;q=0.9'
});

await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
console.log(await page.evaluate(() => navigator.language));
await browser.close();

Call the method before goto(), because the initial document request occurs during navigation. The setting also applies to subsequent requests initiated by that page, including resource requests and navigations, subject to browser and protocol behavior.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Header-name and ordering caveats

Puppeteer’s documented API lowercases header names and does not guarantee outgoing header order. HTTP header names are case-insensitive, so an assertion should compare names without relying on capitalization. Do not write a test that expects Accept-Language to appear before or after another header.

Puppeteer is a framework interface over Chrome automation (and also supports Firefox); this API is not a special command-line switch that applies to every headless launcher.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Chrome DevTools Protocol: control the Network domain

CDP provides two related methods. Network.setUserAgentOverride accepts an acceptLanguage parameter described as the browser language to emulate. That method also requires the userAgent value, so provide the existing or intended user-agent string as well. Network.setExtraHTTPHeaders injects a header map for page requests without asserting broader locale behavior.

Using acceptLanguage

const client = await page.target().createCDPSession();
await client.send('Network.enable');
await client.send('Network.setUserAgentOverride', {
  userAgent: await page.evaluate(() => navigator.userAgent),
  acceptLanguage: 'fr-FR,fr;q=0.9'
});
await page.goto('https://example.com');

Use the CDP client/session creation method provided by your automation library. The important ordering is enabling the Network domain, sending the override before navigation, and supplying the required userAgent field together with acceptLanguage.

Using CDP extra headers

const client = await page.target().createCDPSession();
await client.send('Network.enable');
await client.send('Network.setExtraHTTPHeaders', {
  headers: {
    'Accept-Language': 'fr-FR,fr;q=0.9'
  }
});
await page.goto('https://example.com');

This is the CDP equivalent of direct header injection. Choose it when the exact request header is the requirement and you do not need JavaScript-visible locale or formatting changes.

Protocol-version considerations

CDP evolves with Chrome. Check the protocol documentation that matches the Chrome build installed in CI or production, and keep the automation library and browser versions compatible. A method or parameter accepted by one Chrome version should not be assumed to behave identically in another without verification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Accept-Language syntax and useful test cases

The value is a comma-separated preference list. A quality value (q) expresses relative preference; omit it for the first choice or use a value between zero and one for fallbacks.

Value Meaning Typical use
en-US U.S. English only Test a single regional locale.
fr-FR,fr;q=0.9 French as used in France, then generic French Test regional fallback.
de-DE,de;q=0.9,en;q=0.8 German regional preference, German fallback, then English Exercise server negotiation with multiple choices.
* Any language is acceptable Test wildcard handling; do not confuse it with a concrete locale.

Include a regional tag only when the application distinguishes regions. Otherwise, a language-only value such as fr may be sufficient. Test the fallback order your server actually implements rather than assuming every framework resolves it identically.

How to verify the result

Inspect the request at the server

The definitive check for a header test is the request received by the server. Log the Accept-Language field for the navigation request and, when relevant, for an API or subresource request. This catches configuration applied to the wrong page, context, or navigation.

Inspect browser-visible values

For locale emulation, inspect navigator.language and navigator.languages, then render a number and date with Intl.NumberFormat and Intl.DateTimeFormat. A correct header with an unchanged navigator.language is expected when you deliberately chose header-only injection.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check redirects and new contexts

Follow the complete redirect chain in server logs. A new browser context or page created after configuration does not inherit page-level Puppeteer settings automatically. In Playwright, ensure the page belongs to the context where the option was set. Repeat the check after redirects and client-side navigations.

Common failures and fixes

The server still sees the default language

  • Set the header or locale before the first goto().
  • Confirm the request came from the configured page/context, not a separately created one.
  • Inspect the final request after redirects, not only an initial client-side event.
  • Check that a proxy, service worker, or upstream gateway is not replacing the header.

navigator.language did not change

You probably injected only a request header. Use Playwright locale or CDP’s acceptLanguage emulation when JavaScript-visible language is part of the behavior under test.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Date and number formatting remain unchanged

Extra headers do not promise formatting changes. Configure the Playwright context’s locale and verify with the Intl APIs. Also make sure your assertion accounts for the browser’s locale data and time zone; language selection alone does not set a time zone.

The CDP call fails with a missing parameter

Network.setUserAgentOverride requires a userAgent value in addition to acceptLanguage. Read the protocol definition for the Chrome version in use and send all required fields.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An assertion fails because of capitalization or order

In Puppeteer, header names are lowercased and header order is not guaranteed. Compare the case-insensitive name and value, not the serialized order.

Only the first request has the desired value

Check whether the setting was attached to a page that was later replaced, or whether another context-level or page-level header override took precedence. Configure the stable context/page used for all navigations and inspect a later request as well as the document request.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, isolation, and reliability

Header configuration itself is lightweight; the cost usually comes from the navigation and the page work you are testing. Reuse a browser process when appropriate, but isolate tests that require different locales in separate contexts. In Playwright, contexts provide a clean boundary for locale and extra-header settings. In Puppeteer, create and configure each page deliberately so a prior test’s headers do not leak into the next one.

Prefer deterministic server fixtures for assertions. Real sites can select content using cookies, geolocation, account settings, or cached responses in addition to Accept-Language. If a test is intended to prove language negotiation, record the received header and response language independently. If it is intended to prove the complete user experience, assert the DOM text, navigator.language, and formatting output together.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Pin or regularly validate the Chrome and automation-library versions used by CI. CDP methods and framework APIs can evolve, and a successful local run does not prove that a different installed Chrome build exposes the same protocol surface.

Or skip the browser setup

If your goal is a clean screenshot rather than an interactive browser test, ScreenshotNeo accepts a URL and returns a PNG, JPEG, WebP, or PDF. You can pass the language header through its custom-header option while avoiding local Chrome setup. See the ScreenshotNeo documentation for the current parameter names and complete option list.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -d 'headers[Accept-Language]=fr-FR,fr;q=0.9' -o shot.webp

ScreenshotNeo can accept cookie and consent banners before capture and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan. Sign up for the free plan to try it without adding a card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Should I set locale or Accept-Language in Playwright?

Use locale for complete locale behavior, including navigator.language and date/number formatting. Use extraHTTPHeaders when only the exact request header matters.

Does changing Accept-Language change the browser’s time zone?

No. Language selection and time-zone emulation are separate settings; test or configure the time zone independently when it affects output.

Can I rely on a Chrome launch flag for this header?

The documented approaches here are CDP and framework APIs. Do not assume one launch argument works consistently across launchers and Chrome versions without checking that exact combination.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.