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).
Mozilla Firefox
Go to about:config, read the warning, and click the “I’ll be careful, I promise!” button.
In the filter box, search for useragent.

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.

Using Googlebot's User Agent
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.
Google Chrome
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.

Click on the settings icon in the 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.

Select one of the preset user agents
Unfortunately, changes are only in effect when the developer tools panel is open. It will reset once you close the panel.
Internet Explorer
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.

Changing IE's user agent
A custom user agent can also be added.

Adding Googlebot as a user agent
Custom user agents are saved to the list. However, IE reverts to its default user agent when the browser is closed.
Opera
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.

Opera is a bit limited in user agent options
Changes remain in effect even after the browser restarts.
Safari
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”.

Show the Develop menu
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.

Safari's preset user agents
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.