---
title: "Change User Agent in Chrome, Edge, Firefox and Safari"
description: "How do you change user agent? Use DevTools Network conditions in Chrome or Edge, about:config in Firefox, or Develop in Safari. Learn to verify and reset it."
url: "https://donutbrowser.com/ja/change-user-agent/"
---

1. [ホーム](https://donutbrowser.com/ja/)

2. [ブログ](https://donutbrowser.com/ja/blog)

3. Change User Agent in Chrome, Edge, Firefox and Safari

# Change User Agent in Chrome, Edge, Firefox and Safari

October 20, 2026

user agent chrome devtools client hints

**To change user agent in Chrome or Edge, open DevTools, go to [Network conditions](https://developer.chrome.com/docs/devtools/device-mode/override-user-agent), clear “Use browser default” and pick or paste a string. In Firefox, set `general.useragent.override` in `about:config`; in Safari, enable web developer features in Settings, Advanced, then use Develop, User Agent. A string isn’t enough: Client Hints and JavaScript values may still show your real device.**

A site serves a mobile layout on your desktop, a bot-check page, or a different version of a page than you expected. To reproduce it, you change user agent and see what the server sees. QA engineers, SEO checkers and people who run separate identities in one browser all do this.

You’ll be able to change the string, confirm it worked, reset it, and judge when one header isn’t enough.

> **Key Takeaways**

> - **Scope differs:** DevTools affects one open tab, the Firefox preference is global until reset, and extensions persist.

> - A Playwright context override doesn’t change Client Hints or other fingerprint signals by itself.

> - A user agent that disagrees with platform, touch points, screen size, WebGL renderer, time zone or IP can be flagged.

> - A fake user agent isn’t a legitimate way to evade a ban or access control.

## What does changing your user agent actually change?

Changing your user agent changes one string, the User-Agent request header, while the Client Hints and JavaScript values that also describe your browser stay as they were.

![A hand pulls a lever that modifies incoming data, and outputs a website as seen on an antiquated browser.](https://api.birchseek.com/m/5oMqz-0QCaODYy652O2ySAbXSkuY2a50.webp)

[MDN’s User-Agent reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) describes the User-Agent request header as a string that lets servers identify the application, operating system, vendor or version of the requesting user agent. Your browser attaches it to every request, so a server sees it before any page code runs.

Chrome now sends a reduced string: in the examples on [Chrome for Developers](https://developer.chrome.com/docs/privacy-sandbox/user-agent/), only the major version is real, as in `Chrome/98.0.0.0`. The finer detail moved to User-Agent Client Hints.

[MDN’s User-Agent Client Hints API page](https://developer.mozilla.org/en-US/docs/Web/API/User-Agent_Client_Hints_API) lists two routes:

- **Sec-CH-UA request headers:** the browser sends them, and a server can ask for more detail.

- **`navigator.userAgentData`:** a JavaScript property that page scripts read directly.

Older properties such as `navigator.platform` are a third, separate source.

This is why values can disagree. Paste an iPhone string into DevTools and the User-Agent header says iPhone, but `navigator.userAgentData` and the `Sec-CH-UA-Platform` header can still say Windows. A site that compares them sees a mismatch, and that comparison is part of [browser fingerprinting](https://donutbrowser.com/browser-fingerprinting/).

## Why change your user agent, and what is off limits?

You change your user agent to see how a site treats different clients, never to dodge a ban or an access control.

**Legitimate reasons**

1. **QA across layouts.** [Geekflare’s guide](https://geekflare.com/dev/change-user-agent-in-browser/) notes that a website can change its design elements and resolution based on the user agent, so you can check a mobile layout from your desktop.

2. **Responsive and device testing.** As [Search Engine Journal](https://www.searchenginejournal.com/change-user-agent/368448/) puts it, developers need to see how sites behave in different browsers and devices. A changed string is a quick first pass, not a replacement for a real device.

3. **Checking what a server sends each client.** Load the page with a desktop string, then a phone string, and compare the responses.

4. **SEO cloaking checks.** Copy Googlebot’s current user agent strings exactly as Google Search Central’s crawler documentation lists them, not an older pattern from a blog post. [Google’s verification page](https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot) covers the other side: “You can verify if a web crawler accessing your server really is a Google crawler, such as Googlebot.”

A changed UA only shows what a server sends to that string. It doesn’t make you Googlebot, and a cloaking check is for comparing page versions.

**Off limits**

These steps are not for evading a ban or bypassing an access control with a fake UA.

Spoofing also carries risk. [WhatIsMyTools warns](https://whatismytools.com/blog/how-to-change-your-user-agent) that a UA that disagrees with your Client Hints and the JavaScript platform value can be flagged, because modern sites cross-check the header against “a dozen other signals.”

## How do you change the user agent in Chrome, Edge, Firefox and Safari?

Each browser changes the user agent in a different place and for a different length of time. Verify every change, because the request header and the values JavaScript reads can disagree.

### Chrome

Chrome changes the user agent for the current tab only, and only while DevTools stays open. [Chrome’s DevTools documentation](https://developer.chrome.com/docs/devtools/device-mode/override-user-agent) puts the setting in the Network conditions panel.

1. Press `F12` (or `Cmd+Option+I` on macOS) to open DevTools.

2. Open the ⋮ menu, then **More tools**, then **Network conditions**.

3. Under **User agent**, clear **Use browser default**.

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

5. Keep DevTools open and reload the page.

**Verify.** Open the **Network** panel, click the first (document) request, and read `User-Agent` under Request Headers. Then run this in the Console:

```
navigator.userAgent;
navigator.platform;
navigator.userAgentData; // brands, mobile, platform
navigator.userAgentData?.getHighEntropyValues(["platformVersion"]);
```

If `userAgent` shows your string but `userAgentData` still names the real browser, a page can see through the change.

**Reset.** Tick **Use browser default** again, or close DevTools.

### Edge

Edge works like Chrome, as [Microsoft’s DevTools documentation](https://learn.microsoft.com/en-us/microsoft-edge/devtools/device-mode/override-user-agent) shows: the setting is in the Network conditions tool.

1. Press `F12` to open DevTools.

2. Open the **Customize and control DevTools** menu (⋯), then **More tools**, then **Network conditions**.

3. Under **User agent**, clear **Use browser default** and pick or paste a string.

4. Reload with DevTools still open.

**Verify.** Read `User-Agent` on the document request in the **Network** tab, then run the same console checks as in Chrome.

**Reset.** Tick **Use browser default**, or close DevTools.

### Firefox

Firefox has no built-in switcher, so you set a preference, and it applies to every tab until you remove it.

1. Open a new tab, type `about:config` and accept the warning.

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

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

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

5. Reload the page you’re testing.

**Verify.** Open DevTools (`F12`), go to **Network**, reload, click the document request and read `User-Agent`. In the Console, check `navigator.userAgent` and `navigator.platform`.

A typo in the value raises no error, so always confirm the header after saving.

**Reset.** Find the preference again and click the delete icon beside it. Because the override is global, forgetting this step changes every site you open.

### Safari

Safari changes the user agent for the current tab through the Develop menu, which Settings hides until you turn it on.

1. Choose **Safari**, then **Settings** (not Preferences), then **Advanced**.

2. Tick **Show features for web developers**.

3. Open the **Develop** menu, then **User Agent**.

4. Pick a listed browser, or choose **Other** and type a string.

5. Reload the page.

**Verify.** Choose **Develop**, then **Show Web Inspector**, open **Network**, reload and read the `User-Agent` request header. Then check `navigator.userAgent` and `navigator.platform` in the Console.

**Reset.** Choose **Develop**, then **User Agent**, then **Default**.

A changed header is only one signal. Run our [browser fingerprint check](https://donutbrowser.com/tools/browser-fingerprint) to see whether the header, the Client Hints and the JavaScript values agree.

## Which way to change user agent fits your task?

The right way to change user agent depends on how long the change must last and whether one string is enough.

| Method | Scope and persistence | What it changes | How to verify |
| --- | --- | --- | --- |
| Chrome or Edge DevTools | Current tab, only while DevTools is open | UA string | Network panel, then console |
| Firefox `about:config` | Global until you reset it | UA string | Network panel, then console |
| Safari Develop menu | Current tab | UA string | Network panel, then console |
| Browser extension | Persistent, switches across tabs | UA string | Network panel, then console |
| Automation library | Per context or page in the script | UA string, not the rest of the fingerprint | Log request headers in the script |
| Per-profile fingerprint | Set per profile | UA with platform, time zone and WebGL | Fingerprint test page |

The first four rows change one string, and a script override has the same limit. Check both the request header and what the page reads in JavaScript, including Client Hints.

| Your task | Use | Why |
| --- | --- | --- |
| One-off testing | DevTools | Nothing to install, nothing to undo |
| Persistent switching | Extension | Stays on as you move between tabs |
| Scripted tests | Automation library | Set in code, per context |
| Separate identities | Per-profile fingerprint | The UA agrees with the rest of the device |

**One changed header does not isolate accounts, because cookies, IP and fingerprint still link them.**

If you run separate identities for clients, brands or regions, the last row is the one that fits. Our guide to [what an anti-detect browser is](https://donutbrowser.com/what-is-an-anti-detect-browser/) explains how per-profile fingerprints and cookie stores work. For testing and scripts, the first rows are enough.

## How do you set the user agent in Playwright, Puppeteer and Selenium?

You set the user agent in Playwright on the browser context, in Puppeteer on the page, and in Selenium through a Chrome option. Each call changes the header, but none of them rewrites everything a site can read.

**Playwright** (JavaScript): pass `userAgent` when you create the context.

```
const context = await browser.newContext({ userAgent: '<your UA string>' });
const page = await context.newPage();
```

**Puppeteer**: call `page.setUserAgent` before you navigate.

```
await page.setUserAgent('<your UA string>');
await page.goto('https://example.com');
```

**Selenium with Chrome** (Python): pass the `--user-agent` switch through Chrome options.

```
options = webdriver.ChromeOptions()
options.add_argument("--user-agent=<your UA string>")
driver = webdriver.Chrome(options=options)
```

### How do you verify the change?

Run both checks for every method. Skipping the second is the usual mistake.

1. **Read the request header.** In a headed run, open DevTools, go to the Network panel, click the document request and find `User-Agent` under Request Headers. In a headless run, log `request.headers()` from a `page.on('request')` handler in Playwright.

2. **Read what the page sees.** Run this in the page’s console, or through your library’s evaluate call:

```
console.log(navigator.userAgent, navigator.platform, navigator.userAgentData);
```

Success means `navigator.userAgent` and the header both show your string. Then compare the rest.

Set a macOS string in a Playwright context on a Linux machine, and the header and `navigator.userAgent` say macOS. But `navigator.platform` can still say Linux, and `navigator.userAgentData` can still list the real browser brands.

A context-level override doesn’t by itself change Client Hints or other fingerprint signals such as WebGL or time zone. If a site compares those values, set them explicitly or use a tool that sets them together. For scripted runs at scale, see our [browser automation use case](https://donutbrowser.com/use-cases/automation/).

## What else must match a changed user agent?

A changed user agent only holds up when the other values your browser reports tell the same story, because detection systems compare them. [WhatIsMyTools](https://whatismytools.com/blog/how-to-change-your-user-agent) says “flipping that one header rarely makes you anonymous, because modern sites cross-check it against a dozen other signals.”

**Signals to align with the new user agent**

- **Platform:** `navigator.platform` should match the operating system in the string. MDN documents both `navigator.platform` and `navigator.maxTouchPoints`.

- **Touch points:** a phone string should come with [`maxTouchPoints`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/maxTouchPoints) above 0.

- **Screen size:** the screen should fit the device the string names.

- **WebGL renderer:** the GPU string should fit the claimed device, not name an Apple GPU under a Windows string.

- **Time zone and language:** both should fit the claimed region.

- **IP location:** the IP should sit where the time zone says you are.

Three mismatches are easy to produce: a Windows string with a Mac value in `navigator.platform`, an iPhone string with no touch points and a desktop screen, and a New York IP with an `Asia/Ho_Chi_Minh` time zone. Our [guide to matching proxies with time zone and language](https://donutbrowser.com/proxies-for-anti-detect-browsers/) covers the last one.

Paste a Windows string into a Mac browser, and one console line exposes the contradiction:

```
[navigator.userAgent, navigator.platform]
```

The first value says Windows. The second returns a Mac value such as `MacIntel`. Any script on the page can run the same line, and that mismatch is what a check can flag.

**Self-check**

1. Open the Network panel and read the `User-Agent` request header.

2. In the console, run `navigator.userAgentData` and read its brands and platform (the Client Hints).

3. Open Donut Browser’s free [browser fingerprint tool](https://donutbrowser.com/tools/browser-fingerprint/) and compare its platform, screen, WebGL and time zone values.

4. Run the free [bot detection tool](https://donutbrowser.com/tools/bot-detection/) and look for flagged contradictions.

If the header, the Client Hints and the JavaScript values disagree, fix the mismatch before you rely on the change.

## Where Donut Browser fits

Donut Browser sets the user agent for each profile inside its browser engine, as one piece of a full device fingerprint, instead of patching a single header.

Each profile runs on Wayfern, a Chromium fork. Wayfern sets the user agent, platform, timezone, language, WebGL, canvas, audio and WebRTC values at the C++ level, not with scripts injected into the page. [The pricing page](https://donutbrowser.com/pricing/) lists full fingerprint protection on the free plan, at the same quality as paid plans.

The limits are plain:

- **Other operating systems:** fingerprints for other operating systems need the [Pro plan](https://donutbrowser.com/pricing/).

- **Automation:** the Browser Manipulation API, which [launches a profile so Playwright or Puppeteer can attach over CDP](https://donutbrowser.com/pro/), is on Pro at $99/month.

- **Scope:** Donut Browser does not sell proxies, is not a VPN or Tor, and does not guarantee against bans.

If you only need a one-off string for testing, DevTools or an extension is enough. If you need a coherent identity per profile, that is what Donut is built for.

The app is [open source under AGPL-3.0](https://donutbrowser.com/open-source-antidetect-browser/) for macOS, Windows and Linux, and the [source code is on GitHub](https://github.com/donutbrowser/donutbrowser), so you can check how it works.

## Frequently asked questions

### How do I change my user agent?

**To change your user agent, open Chrome or Edge DevTools, go to Network conditions, clear Use browser default, and pick or paste a user agent.** In Firefox, set `general.useragent.override` in `about:config`. In Safari, turn on developer features in Settings, then use Develop, User Agent. Verify in the Network panel.

### Why does a site still see my real device?

**Your user agent is only one of several signals a site reads.** Client Hints headers, `navigator.platform`, the WebGL renderer, your time zone and your IP can still show the real device. Compare them with the header.

### How do I reset my user agent to default?

**Undo the setting where you made it.** In Chrome or Edge, tick Use browser default or close DevTools. In Firefox, delete `general.useragent.override` in `about:config`. In Safari, pick Default under Develop, User Agent.

### Does changing my user agent make me anonymous?

**No, changing it hides very little.** Your IP address, cookies and browser fingerprint stay the same, so sites can still link your visits. Accounts that must stay apart need a full fingerprint per profile, as our [browser fingerprinting guide](https://donutbrowser.com/browser-fingerprinting) explains.

### Is it OK to change my user agent?

**Yes, for testing layouts, QA and SEO cloaking checks.** Don’t use a fake user agent to evade a ban or get past an access control.

## Change your user agent, then check that it holds

**Today:** switch the string in DevTools under Network conditions, then compare the `User-Agent` request header with `navigator.userAgent` and `navigator.userAgentData` in the console. If they disagree, the change didn’t fully hold.

**This week:** pick the method from the task table that matches the work you repeat, and run the fingerprint check after each change.

**For separate identities:** try a per-profile setup. [Download Donut Browser](https://donutbrowser.com), set up your first profile, and run the fingerprint check on it. It doesn’t guarantee against bans, but it keeps each profile’s signals consistent.

## Sources

[How to Change Your User Agent (and Why Websites Still Know…](https://whatismytools.com/blog/how-to-change-your-user-agent) · [User-Agent header - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) · [How to Change User-Agent in Chrome, Firefox, Safari, and…](https://geekflare.com/dev/change-user-agent-in-browser/) · [How to Change User-Agents in Chrome, Edge, Safari & Firefox](https://www.searchenginejournal.com/change-user-agent/368448/) · [Verifying Googlebot and other Google crawlers | Google…](https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot) · [developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/maxTouchPoints) · [Pricing: Free Forever, Solo, Pro and Team — Donut Browser](https://donutbrowser.com/pricing/) · [donutbrowser/donutbrowser on GitHub](https://github.com/donutbrowser/donutbrowser)

## Google で当サイトをもっと見る

ワンクリックで Donut Browser を Google アカウントの優先ソースに設定すると、トップニュース、AI モード、AI による概要で当サイトの記事が表示されやすくなります。

Google で優先ソースに設定

## On this page

- What does changing your user agent actually change?

- Why change your user agent, and what is off limits?

- How do you change the user agent in Chrome, Edge, Firefox and Safari?

- Chrome

- Edge

- Firefox

- Safari

- Which way to change user agent fits your task?

- How do you set the user agent in Playwright, Puppeteer and Selenium?

- How do you verify the change?

- What else must match a changed user agent?

- Where Donut Browser fits

- Frequently asked questions

- How do I change my user agent?

- Why does a site still see my real device?

- How do I reset my user agent to default?

- Does changing my user agent make me anonymous?

- Is it OK to change my user agent?

- Change your user agent, then check that it holds

- Sources
