HeaderDial › Guides

How to change the User-Agent header in Chrome

To change the User-Agent header that Chrome or Edge sends, add a request header named User-Agent in HeaderDial with the operation set and the string you want. Every matching request then carries your value instead of the browser's. This changes the HTTP header only. JavaScript running in the page still sees the real browser through navigator.userAgent, which matters if the site detects devices on the client side.

When you need this

Steps

  1. Click the HeaderDial icon to open the popup. If you see the site-access banner, choose Allow on all sites or Only <current host>.
  2. Click + Request header. Start typing User-Agent and pick it from the suggestions.
  3. Paste the new string into the value field. For example, a typical iPhone Safari string looks like this:
    Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1
  4. Choose the operation. set replaces the browser's string. append adds your text to it, which is handy for tagging test traffic (for example qa-run-42) while keeping the real string. User-Agent is one of the request headers browsers allow appending to.
  5. Open Where it applies, click + Only on <current host> or + Only on…, and enter the domain under test.
  6. Reload the page. If the server already sent a cached, device-specific page, do a hard reload (Ctrl+Shift+R).

What changes and what doesn't

Where the user agent shows upChanged by a header rule?
User-Agent request header seen by serversYes, on matching requests
navigator.userAgent in page JavaScriptNo
Client hints headers such as Sec-CH-UA, Sec-CH-UA-Mobile, Sec-CH-UA-PlatformNot unless you add rows for them too
navigator.userAgentData in JavaScriptNo
CSS media queries, screen size, touch supportNo

A server that reads client hints may see a Windows Chrome in Sec-CH-UA-Platform and an iPhone in User-Agent. If your detection uses client hints, add rows for those headers as well and test what the server makes of the combination.

The DevTools and curl alternatives

Chrome DevTools can override the user agent too: open the Network conditions panel, untick "Use browser default" and pick or type a string. That changes both the header and navigator.userAgent, but only for the tab that has DevTools open and only while DevTools stays open. For whole-page emulation, including screen size and touch, use the device toolbar. A header rule fits best when you want the header changed in every tab without DevTools, or only for specific hosts.

curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1" -I https://www.example.com/
# same as: curl -H "User-Agent: ..." 

Pitfalls

Do not apply a custom User-Agent to all sites for long. Sites may serve broken layouts, refuse logins, or flag you as a bot. Scope it with a filter, or give the row an expiry such as 1 hour so it switches itself off.

Add to ChromeFirefox: coming soon