When accessing a website, the browser sends a text string known as the user agent to tell it what type of browser, operating system, and version of the operating system the user is using.
Depending on the user-agent, a website can change its design elements and resolution to suit the needs of the device/browser and even offer personalized content. The user agent may not mean much to a normal user, but it is extremely important for web developers as they need to make sure that their website works properly on all browsers and operating systems.
This is also true for marketers who need to verify that their campaigns work correctly on different browsers and operating systems. However, testing a website on all operating systems and browsers is not practical.
Fortunately, user-agent spoofing is a thing, and all popular browsers can spoof the user agent to make websites think the user is using a completely different browser and device. So if someone wants to test your web related work, they can simply change the user agent in their favorite browser.
If you’re wondering how to do that, read on and I’ll show you how to change the user agent in Chrome, Opera, Microsoft Edge, Safari, and Firefox.
Change user-agent in Chrome, Opera, and Microsoft Edge.
Because Chrome, Opera, and Edge are all Chromium-based browsers, the instructions for changing the user agent in them are almost the same. You can use the manual method to change the user agent from the developer tools or using a dedicated extension. I’m going to show you both methods.
Change the user agent of the Inspect Element window.
For the demo, I’m going to use Chrome. You can also follow the exact same instructions in Opera or Microsoft Edge:
Right-click on the web page and select Inspect or Inspect Element from the context menu.
Now click on the three vertical dots menu at the top right corner and select the Network Conditions option from the More Tools .
A new panel will open at the bottom. Here uncheck the checkbox next to the Use default browser option in User Agent .
Then click on the user agents menu here and a list of user agents will open up. This includes old versions of Android, Microsoft Edge, Opera, Firefox, Chrome, Safari, and UC Browser on different operating systems.
Select any of the user agents here, and then reload the page (press the F5 key), making sure the Inspect Element window is there when you do so. The reloaded page will open with the new user agent.
If you want to restore normal navigation, simply close the Inspect Element window and reload or move to a different web page. If you want to interact with the web page and navigate the website, you must keep the Inspect Element window open. You can reduce the size of the window if it gets in your way.
Use an extension to switch user agents
If you need to switch user agents frequently or want a larger pool of user agents, it is recommended to use an extension. We will be using a Chrome extension. By default, Edge supports the Chrome extension, but you will need to install the Opera plugin to install Chrome extensions on it.
Although Google has its own User-Agent Switch extension, I find it very limited and not worth using as it lacks some necessary features.
I’ll recommend you use the User Agent Manager and Switcher extension instead. It has a user agent for almost all operating systems and browsers. Not only that, it even has a user agent for almost all browser and operating system versions.
The extension has two dropdown menus at the top. One lists all supported browsers and the other lists all supported operating systems.
Once you select your desired browser and operating system, all browser versions will be listed along with the operating system versions. Select the required user agent from the list and click the Apply button below. You will have to reload the page to see the changes.
The new user agent will persist across new tabs, so all your browsing will use the spoofed user agent. To undo this, open the extension again and click resume . This will reset all user strings and the default will be selected. However, you will still have to reload the page.
Change user-agent in Firefox.
It’s a bit difficult to manually create a new user agent in Firefox, so I’ll recommend you use a Firefox plugin. Although I’ll also show you how to do it manually, in case you don’t want to use a plugin.
Manually create a user agent string
In the Firefox search bar, find about:config
and accept the warning message that appears.
Here type general.useragent.override
in the preferences search bar. Firefox will offer to create a new preference with the same name. Select the Lace option above this and then click the “+” (plus) icon at the end.
This will create a new preference with an empty space to add a user agent string. You will need to manually add a user agent string here. Here is a list of all user agents. Find the required user agent and copy/paste it into the preference you created and click to Save .
That’s it, the user agent preference will be created and now all navigation in your Firefox browser will use this new user agent. You can keep changing this string to try different user agents.
To reset the default user agent, you will need to delete the preference you created. Just click the Dumpster next to this preference to delete it immediately.
Use a Firefox add-on.
Fortunately, the User Agent Manager and Switcher extension is also available for Firefox. It also works the same way as in Chrome. Select your preferred browser and operating system from the top menu and then select the user agent from the list to apply.
Alternatively, you can also check out the User-Agent Switcher Firefox Add-on. It’s a bit easier to use as you just need to click on a user agent in the list and it’s applied immediately. However, the list of user agents it offers is very limited.
Change user-agent in Safari.
In Safari, you don’t need to go through complicated settings to change the user agent; you can change it directly from the main menu. First you need to enable developer mode. That’s how:
Use the Preferences from the Safari tool .
Here move to the Advanced tab and check the checkbox next to Show Develop menu in menu bar .
A new Development Survey menu will appear in the menu bar next to Bookmarks; click on it and hover your mouse cursor over the User Agent option. You will see a list of available user agents that you can select to change immediately. You can also click Other… to add a custom user agent string just like we did in Firefox above.
To undo the user agent change, you will need to go back to the same Develop menu and select Default under User Agent .
Final thoughts
I will recommend you to use a dedicated extension to change the user agent in your browser. They are more versatile and make it easy to switch between multiple user agents. It’s also worth knowing that if your browser/extension doesn’t offer your preferred user agent, you can also find your string like we did for Firefox and add it manually.