Is a website restricting access based on your browser? Do you want to view what a site looks like on a mobile device? Many sites detect the visitor’s browser based on the user agent, which is sent to the site’s server with each page request. This user agent contains information such as your operating system, web browser, and browser version.
For example, Googlebot’s user agent would be: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html).
To bypass browser-based restrictions, this user agent would need to be spoofed.
We previously explained how to edit Firefox’s user agent using an extension called User Agent Switcher. However, what if you’re using a different browser or you don’t want to install extra extensions? Here are instructions for spoofing the user agent on Firefox, Chrome, Internet Explorer, Opera, and Safari without any extensions (click on the browser name to jump to its section).
Go to about:config, read the warning, and click the “I’ll be careful, I promise!” button.
In the filter box, search for useragent.
Look for a preference name of general.useragent.override. It’s not included by default, so its okay if it doesn’t exist. Right click anywhere and select New > String. For the preference name, enter general.useragent.override. For the preference value, enter in whatever user agent you want. Changes take place immediately, so no restart is required. In addition, the change remains in effect even after restarting the browser.
To modify the user agent at any time, right click the preference name and select Modify. To go back to the default Firefox user agent, right click and select Reset.
From the Tools menu, go to Tools > Developer Tools. The developer tools pane will appear. Click on the small settings icon in the bottom right corner.
In the overlay box that appears, check the box labeled Override User Agent. You can then select one of the preset user agents or enter your own by selecting Other.
Unfortunately, changes are only in effect when the developer tools panel is open. It will reset once you close the panel.
Hit the F12 shortcut key or go to Tools > Developer Tools to open the developer tools pane. At the top of the developer tools pane, go to Tools > Change user agent string. From there, you can select from a number of preset user agents.
A custom user agent can also be added.
Custom user agents are saved to the list. However, IE reverts to its default user agent when the browser is closed.
Head to opera:config. In the Quick Find bar, type in user agent. Click on the title bar to expand the User Agent item if it’s not already expanded.
Opera is a bit limited in options here. You can enter in 5 different numbers, which correspond to Opera, Firefox, and Internet Explorer. For the latter two, you can either choose to have Opera mentioned in the user agent or hide it completely.
Changes remain in effect even after the browser restarts.
On Windows, first make sure the menu bar is shown (Tools > Show Menu Bar). If the Develop menu is not there, then head to Edit > Preferences > Advanced. Check the box labeled “Show Develop menu in menu bar”.
Go to Develop > User Agent. There are numerous preset user agents to choose from, as well as an option to enter a custom one. Selecting one will automatically reload the page.
This option is only in effect on the current tab and resets when the browser restarts.
What is your preferred way of spoofing user agents? Share with us in the comments.