Firefox 47 ships with a new feature that enables you to change the user agent on individual tabs temporarily.
The feature, designed to help webmasters and designers test web resources using different user-agents, can be used by regular users of the browser as well in the same fashion.
While it is usually not necessary to change the user agent when accessing sites, some sites may provide access to different content based on the user agent of the connecting web browser.
Just recently, we have noticed that Google was delivering different content to users connecting with Microsoft Edge, and that switching the user agent over to Chrome or Internet Explorer, would change that.
Firefox 47: Tab-Based User-Agent switching
Mozilla added the new feature to Firefox 47's Web Developer Tools, or more precisely, the browser's responsive design tool which allows you to test the design of a website using different size presets.
To make use of it, do the following:
- Hit F12 to open Firefox's Developer Tools and click on the responsive design tool when the interface opens, or use the shortcut Ctrl-Shift-M directly instead.
- There you find listed options to modify the size of the browser window (by emulating it inside Firefox), and the new option to add and use a custom user agent.
The new feature ships without any presets which means that you need to add the user agent yourself. It is possible that Mozilla may change this before the feature lands in the browser as it is highly uncomfortable to use currently as entered user agents are not remembered either by the tool.
This means, basically, that you need to have a list of user agent strings ready for copying and pasting whenever you are about to use the tool.
The benefit of the new option, opposed to changing the user agent permanently in Firefox's advanced configuration or using an extension, is that it is temporary only and does not require third-party tools.
To change the user agent permanently in Firefox, do the following:
- Type about:config in the Firefox address bar and hit enter.
- You may receive a warning prompt, accept it to continue.
- Search for the preference general.useragent.override.
- It does not exist by default, so right-click on the page and select New > String from the context menu.
- Name it general.useragent.override.
- Enter the full user agent as the value.
Both methods let you change the user agent, but they don't work well if you need to switch between different agents regularly. If that is the case, the best solution is to use a Firefox add-on such as User Agent Switcher which enables you to do that.
While you need to add user agents to it as well, it is a one-time operation and switching between agents is done with just a couple of clicks.