---
title: "Spoof User Agent Without Extension: 4 Built-in Methods"
description: "Spoof a user agent without an extension using Chrome DevTools, Firefox about:config, Safari's Develop menu or Playwright. Learn how to verify the change."
url: "https://donutbrowser.com/fr/spoof-user-agent/"
---

1. [Accueil](https://donutbrowser.com/fr/)

2. [Blog](https://donutbrowser.com/fr/blog)

3. Spoof User Agent Without Extension: 4 Built-in Methods

# Spoof User Agent Without Extension: 4 Built-in Methods

November 21, 2026

user agent chrome devtools playwright

**You can spoof a user agent without an extension in four ways: Chrome DevTools Network conditions, Firefox’s `general.useragent.override` setting, Safari’s Develop menu, or the user agent setting in Playwright and Puppeteer. A new string may not change what a site sees, because Client Hints and platform values can still name your real device, so check both the HTTP header and `navigator.userAgent`.**

You may need a site to treat your browser as another browser or device: a phone layout to check, a bug to reproduce, a script that expects a set string. Built-in settings let you spoof user agent without extension permissions. No add-on gets to read and change every page you open.

After reading, you can change the string in each browser, confirm the site received it, and tell when the string alone is not enough. I build an anti-detect browser, so each method comes with its trade-off.

> **Key Takeaways**

> - Scope decides the method: DevTools changes one tab, a Playwright option one context, a Firefox preference every tab in that profile.

> - A method can change the header and miss `navigator.userAgent`, or the reverse, so neither value proves the change alone.

> - A Windows string next to macOS values for `navigator.platform`, WebGL, timezone and language is a contradiction a site can read.

> - A changed user agent leaves your IP address and the rest of your fingerprint as they were.

## What is a user agent string and what do its parts mean?

A user agent string is a line of text your browser sends in the `User-Agent` request header and exposes as `navigator.userAgent`. It names the browser, its engine and the operating system, so servers and scripts can adapt content.

![Illustration for What is a user agent string and what do its parts mean?](https://api.birchseek.com/m/FeFUX1msI4IYlZd1FbP0JHoeVlVkBICx.webp)

[MDN’s User-Agent header reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) describes the header as “a characteristic string that lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent.”

Chrome for Developers calls Chrome’s current format [User-Agent Reduction](https://developer.chrome.com/docs/privacy-sandbox/user-agent/): the default string carries limited version and device detail. Detailed values are exposed through User-Agent Client Hints, a separate set of values a site has to ask for.

Chrome’s reduced desktop string for Windows looks like this:

```
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<majorVersion>.0.0.0 Safari/537.36
```

Read left to right:

- **`Mozilla/5.0`** is the product token, which nearly every browser still sends for historical compatibility.

- **`(Windows NT 10.0; Win64; x64)`** is the platform and OS, in parentheses.

- **`AppleWebKit/537.36 (KHTML, like Gecko)`** is the engine token.

- **`Chrome/<majorVersion>.0.0.0`** is the browser and its version, and only the major number is real.

- **`Safari/537.36`** is another compatibility token.

The same string reaches a site by two routes. The server reads the `User-Agent` header on each request.

A script reads `navigator.userAgent`, which [MDN’s Navigator reference](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent) defines as returning “the user agent string for the current browser.” A tool can change one route and leave the other alone.

## How to spoof user agent without extension in Chrome, Firefox and Safari

Chrome, Firefox and Safari each have a built-in way to change the user agent, and each reaches a different distance: one tab, one Safari session, or one whole profile. Every example below uses a Safari-on-iPhone string: `Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1`.

### Chrome DevTools Network conditions (one tab)

1. Press F12 (or Cmd+Option+I on macOS) to open DevTools on the tab you want to change.

2. Open the three-dot menu in DevTools, choose **More tools**, then **Network conditions**.

3. Find the **User agent** section and clear **Use browser default**.

4. Pick a preset from the list, or paste your own string into the custom field.

5. Reload the page with DevTools still open.

Success looks like a changed layout after the reload. If you close DevTools, expect the override to stop. Other tabs keep their normal string.

### Firefox `general.useragent.override` (whole profile)

1. Type `about:config` in the address bar and accept the warning.

2. Search for `general.useragent.override`.

3. If it doesn’t exist, type the name, choose **String**, and click the plus button.

4. Paste your user agent as the value and save it.

5. Reload the page you’re testing.

The preference lives in the current profile, so every tab and window in it uses the string until you reset it. Reset it with the reset or delete button next to the name.

### Safari Develop menu (set from the menu bar)

1. Open Safari settings and go to **Advanced**.

2. Turn on the option that shows the Develop menu (or web developer features) in the menu bar.

3. Choose **Develop**, then **User Agent**.

4. Select a listed browser, or choose **Other** to enter your own string.

5. Reload the page.

The menu is a testing aid, so recheck the value after you close the tab or quit Safari instead of assuming it stayed.

### Limits of each method

- **Scope:** DevTools affects one tab, Firefox’s preference affects one profile, and Safari’s menu is set per Safari session.

- **Persistence:** DevTools ends when you close it, Firefox keeps the value until you reset it, and Safari’s choice is best treated as temporary.

- **Consistency:** None of these methods promises that User-Agent Client Hints or platform values change with the string, so a site can still see your real device.

## How to spoof user agent without extension in Playwright or Puppeteer

Playwright and Puppeteer set the user agent in code, so nothing gets installed and nobody clicks through a menu. That suits repeatable QA, where the same string has to load on every run.

1. **Set it in Playwright (JavaScript).** Pass `userAgent` when you create a context. The [Playwright `browser.newContext` documentation](https://playwright.dev/docs/api/class-browser#browser-new-context) describes this option as “Specific user agent to use in this context.”

```
const context = await browser.newContext({
  userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1'
});
const page = await context.newPage();
```

1. **Set it in Playwright (Python).** The option is snake\_case: `browser.new_context(user_agent="...")`. Every page opened from that context uses the string. Setting it on `browser.new_page()` instead gives you a one-page context.

2. **Set it in Puppeteer.** Call `page.setUserAgent()` before `page.goto()`. [Puppeteer’s `setUserAgent` reference](https://pptr.dev/api/puppeteer.page.setuseragent) documents the signature as `setUserAgent(userAgent: string, userAgentMetadata?: Protocol.Emulation.UserAgentMetadata): Promise<void>`. The optional second argument carries the metadata behind User-Agent Client Hints, so pass it when the site reads those values.

```
await page.setUserAgent('Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1');
await page.goto('https://example.com');
```

1. **Verify inside the script.** Run `await page.evaluate(() => navigator.userAgent)` and compare it with the `User-Agent` header your test server logs. Success is the same string in both places. If a site still serves the old layout, check whether you set the string after the first navigation.

Playwright applies the string to one context, and Puppeteer applies it to one page. Close the browser and the setting is gone, so the next run starts from the defaults.

These calls drive any browser the tools launch, and Playwright and Puppeteer launch their own browsers for free. To attach them to a Donut Browser profile over CDP, launching through the API needs Pro, according to the [Donut Browser pricing page](https://donutbrowser.com/pricing). The [automation use case](https://donutbrowser.com/use-cases/automation) covers that route.

## Why can a spoofed user agent still be detected?

A spoofed user agent can still be detected because a site reads more than one signal, and the user agent string is only one of them. Sites compare it with other values your browser reports, and a mismatch stands out.

The string lives in two places: the `User-Agent` request header and `navigator.userAgent` in JavaScript. Depending on the method, a change can reach one and miss the other. A server then sees one device while a page script sees another.

Chromium browsers add a second channel. Chrome for Developers documents [User-Agent Client Hints](https://developer.chrome.com/docs/privacy-sandbox/user-agent/), where the browser sends `Sec-CH-UA`, `Sec-CH-UA-Mobile` and `Sec-CH-UA-Platform` headers.

[MDN’s client hints guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Client_hints) groups these under low entropy hints, and `navigator.userAgentData` exposes the same data to scripts.

If you change only the `User-Agent` header, those hints can still describe your real device. A Windows string in the header next to a different `Sec-CH-UA-Platform` value is a contradiction a server can read without running any script.

The same logic applies beyond the browser’s own headers. Each of these pairs tells two stories:

- A Windows UA with a macOS platform value in `navigator.platform`.

- A Windows UA with a WebGL renderer that names a GPU from a Mac.

- A New York IP with an Asia/Ho\_Chi\_Minh timezone, or a language list that doesn’t fit the IP’s country.

The guide to [browser fingerprinting](https://donutbrowser.com/browser-fingerprinting) lists the other signals a page can read. For the IP side, [proxies for anti-detect browsers](https://donutbrowser.com/proxies-for-anti-detect-browsers) shows how to match a proxy’s location to timezone and language.

When you spoof user agent without extension help for a one-off layout test, the string alone is usually enough. Nobody is checking your story. When a site runs checks, platform, WebGL, timezone, language and proxy location must all describe the same machine.

## How do you check that the user agent change worked?

After you spoof user agent without extension tools, check the change in two places: the request header and the JavaScript property. Then compare them.

1. **Reload with DevTools open.** Press `F12` (or `Cmd+Option+I` on macOS), open the **Network** tab, then reload the tab so it sends a fresh request.

2. **Read the header.** Click the first request in the list (the page document), open **Headers** and scroll to **Request Headers**. `User-Agent` should show your test string. If `Sec-CH-UA`, `Sec-CH-UA-Mobile` or `Sec-CH-UA-Platform` appear, note their values.

3. **Read the JavaScript values.** Open the **Console** tab and run:

```
console.log(navigator.userAgent);
console.log(navigator.userAgentData);
navigator.userAgentData?.getHighEntropyValues(["platform"]).then(console.log);
```

[MDN’s `userAgentData` reference](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgentData) describes `userAgentData` as returning an object for accessing the User-Agent Client Hints API. Firefox and Safari may print `undefined` for it, which is expected. 4. **Compare the results.** The header and `navigator.userAgent` should be identical, and the platform in `userAgentData` should match the operating system in the string. A string that says iPhone next to a platform of `Windows` means the change reached the string only.

If the site still serves the old layout, check these in order:

- **Page loaded before the change.** Reload it, since the earlier response was built for the old string.

- **Cache or service worker.** Tick **Disable cache** in the Network tab, or clear the site’s data under **Application**.

- **Viewport or Client Hints.** Many sites choose a layout by window width or by `Sec-CH-UA-Mobile`, so resize the window or use device emulation.

- **Wrong scope.** A DevTools override covers one tab and a Playwright option covers one context, so confirm you’re checking the tab the method actually changed.

- **Cookie from an earlier visit.** Delete the site’s cookies, because a stored device preference can override the header.

## Which way to spoof user agent without extension fits your goal?

The right method depends on how much of the browser the change has to reach: a tab, a browser profile, an automation context, or a whole device.

| Goal | Method | Scope | Limit |
| --- | --- | --- | --- |
| Test a mobile layout | DevTools Network conditions, plus device mode | One tab | Tied to the open DevTools and that tab |
| One-off site compatibility in Firefox or Safari | `general.useragent.override` in `about:config`, or Safari’s Develop menu | Set in the browser itself | Scope and persistence as each browser documents them |
| Repeatable automation | Playwright context or Puppeteer page setting | One context or page | You keep platform, language and timezone consistent yourself |
| Separate identities that look like different devices | Engine-level fingerprint per profile | One profile | Needs a consistent device, not just a string |

The first three rows change a string, so the header, `navigator.userAgent` and the platform values can still tell different stories. The last row changes the device the profile reports, which makes it the only one aimed at identities that must stay apart.

Extension-based rewriting asks for more access than these built-in routes. The [`yonran/simple-user-agent-spoofer` README](https://github.com/yonran/simple-user-agent-spoofer) tells you to “set the permissions and matches to the wildcards of the URLs you want the spoof to apply to,” so you hand an add-on access to every site you list.

Chrome for Developers says the [`chrome.declarativeNetRequest` API](https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest) is used “to block or modify network requests by specifying declarative rules”, which is the Manifest V3 route for header changes. The extension still has to be installed, kept updated and trusted.

Best use for each route:

- DevTools: a quick look at a responsive layout.

- Firefox or Safari settings: one compatibility check in that browser.

- Playwright or Puppeteer: QA that must repeat the same way on every run.

- Per-profile fingerprint: accounts or clients that need separate devices.

## Where does Donut Browser fit when you need a whole device?

A user agent string is one label on a device, and Donut Browser fits when the rest of the device has to match that label.

Its Wayfern engine sets the user agent, platform, timezone, language, WebGL, canvas, audio and WebRTC values per profile, inside the engine at the C++ level, as the [Wayfern documentation](https://donutbrowser.com/docs/wayfern) describes. No injected page script or request-intercepting extension is involved.

The free plan covers this with no account, according to [Donut’s pricing page](https://donutbrowser.com/pricing).

Donut Browser runs on desktop only and is Chromium-based. It is not a VPN and not Tor, and no browser can guarantee you won’t be banned.

If you use Firefox, Safari or plain Chrome, the earlier sections apply as written. To compare, download Donut Browser and make one free profile, then check its values against your own browser’s.

## Frequently asked questions

### How do I spoof user agent without extension tools?

**Use Chrome DevTools Network conditions, Firefox’s `general.useragent.override`, Safari’s Develop menu, or the `userAgent` setting in Playwright or Puppeteer.** Each changes the string with tools the browser or library already has.

### Does changing the user agent in DevTools stay after I close it?

**Treat a DevTools override as temporary, because it belongs to the tab where you set it and the open DevTools panel.** Open a new tab and read the value again before you trust it. For a change that survives restarts, use the Firefox setting.

### Why does a site still show my real operating system after I changed the user agent?

**The user agent string is one of several signals that name your device.** Make them agree with the string, or read the [guide to browser fingerprinting](https://donutbrowser.com/browser-fingerprinting/) for how sites compare them.

### Is spoofing a user agent legal, and does it make me anonymous?

**Changing your own browser’s user agent is a routine way to test layouts, reproduce bugs and check compatibility, but it is not an anonymity tool.** Your IP address and the rest of your fingerprint stay the same. Don’t use it to get around a ban a site gave for abuse.

### Can Playwright or Puppeteer set the user agent without a browser extension?

**Yes, both set the user agent in code, so nothing gets installed.** Playwright takes a `userAgent` option and Puppeteer sets it on a page. Run the header and `navigator.userAgent` checks inside the script so every run is verified.

## Next steps: pick a method and verify it

Pick the way to spoof user agent without extension software that matches your goal. Then confirm the change in both places a site reads it.

**Today:** For a layout, use DevTools; for a compatibility check, use the Firefox or Safari setting. Read the `User-Agent` request header and `navigator.userAgent` in the console, and if the two differ, fix that before testing anything else.

**This week:** If you automate, move the setting into your Playwright context or Puppeteer page so every run starts the same. Set the timezone, language and locale to match the device your string claims, and keep the platform value in line too.

**This month:** If you need separate identities that look like different devices, use a profile in Donut Browser. [Download Donut Browser](https://donutbrowser.com), create a profile, and run the same two-value check on it. No setting guarantees a site won’t detect or ban you.

## Sources

[User-Agent header - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) · [User-Agent Reduction | Chrome for Developers](https://developer.chrome.com/docs/privacy-sandbox/user-agent/) · [Navigator: userAgent property | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent) · [Playwright Browser API: browser.newContext](https://playwright.dev/docs/api/class-browser#browser-new-context) · [Puppeteer: Page.setUserAgent() method](https://pptr.dev/api/puppeteer.page.setuseragent) · [Donut Browser pricing](https://donutbrowser.com/pricing) · [Client hints - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Client_hints) · [Navigator: userAgentData property - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgentData). Every other source is linked where the article cites it.

## Voyez-nous plus souvent sur Google

En un clic, ajoutez Donut Browser aux sources préférées de votre compte Google : nos articles auront plus de chances d'apparaître dans vos À la une, le Mode IA et les Aperçus IA.

Préférez-nous sur Google

## On this page

- What is a user agent string and what do its parts mean?

- How to spoof user agent without extension in Chrome, Firefox and Safari

- Chrome DevTools Network conditions (one tab)

- Firefox general.useragent.override (whole profile)

- Safari Develop menu (set from the menu bar)

- Limits of each method

- How to spoof user agent without extension in Playwright or Puppeteer

- Why can a spoofed user agent still be detected?

- How do you check that the user agent change worked?

- Which way to spoof user agent without extension fits your goal?

- Where does Donut Browser fit when you need a whole device?

- Frequently asked questions

- How do I spoof user agent without extension tools?

- Does changing the user agent in DevTools stay after I close it?

- Why does a site still show my real operating system after I changed the user agent?

- Is spoofing a user agent legal, and does it make me anonymous?

- Can Playwright or Puppeteer set the user agent without a browser extension?

- Next steps: pick a method and verify it

- Sources
