Firefox 47: Tab-based temporary user agent switching

Martin Brinkmann
Mar 21, 2016
Firefox
|
5

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

firefox custom user agent

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:

  1. 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.
  2. 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:

  1. Type about:config in the Firefox address bar and hit enter.
  2. You may receive a warning prompt, accept it to continue.
  3. Search for the preference general.useragent.override.
  4. It does not exist by default, so right-click on the page and select New > String from the context menu.
  5. Name it general.useragent.override.
  6. 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.

As things stand, Firefox 47 will be released on June 7, 2016 to the stable channel. (via Sören Hentzschel)

Summary
Firefox 47: Tab-based temporary user agent switching
Article Name
Firefox 47: Tab-based temporary user agent switching
Description
Firefox 47 ships with a new Developer Tools feature that enables you to change the user agent for individual tabs of the browser.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. pd said on March 23, 2016 at 3:01 pm
    Reply

    I’m super glad this is just a pissy little developer ‘feature’. Your treatment of this teeny change as a whole article topic Martin gives the impression it’s a feature applied to the top level UI. With that assumption I was all worried that Mozilla had caved into the idiot developers replicating the IE6 mess by only coding for the WebShit, or derivative, engines.

    Can you imagine that? Mozilla includes a UA switcher in the browser’s primary UI? It would be like a giant ‘FAILURE’ badge slammed on the Firefox UI. Don’t worry me with articles like this Martin! :)

  2. wonton said on March 22, 2016 at 1:02 am
    Reply

    cyberfox has user agent switcher in the developer tools i used it few times

  3. User agent spoofing info said on March 21, 2016 at 9:23 pm
    Reply

    I used to use UAControl + User-Agent JS Fixer to hide my real user agent from browser fingerprinting attempts, but I switched to Random Agent Spoofer because the latter is superior for that purpose if you don’t need to present different specific user agents on different websites (e.g. some websites block/change content based on user agent). Some related notes:

    – Random Agent Spoofer sets both the HTTP and Javascript user agent elements, so User-Agent JS Fixer is not necessary if you use that.

    – User-Agent JS Fixer currently only sets the navigator.userAgent Javascript element. There are other Javascript elements which can identify which operating system you’re actually using (e.g. navigator.appVersion, navigator.platform, navigator.oscpu; test this out at https://www.browserleaks.com/javascript ), so it’s only useful for websites that block/change content based on user agent, not websites that attempt to fingerprint your browser (Random Agent Spoofer sets those other Javascript elements).

    1. Pants said on March 22, 2016 at 4:42 am
      Reply

      Thanks for the info. Good to know that RAS covers both headers + JS. I actually have RAS (it’s disabled), haven’t tried it for about 3 months (I might have to have another look). I have two options when it comes to fingerprinting (of course not allowing JS in the first place is step one, but for those that ever do, as a worst case scenario) – reduce entropy/UA=common, or randomize it and hide in the noise. I have come to the opinion that hiding in the noise is best.

      And yes, there are so many elements that leak info. Which is why I found RAS (and I think the addon is great and the ideas fantastic) at the time (I will revisit it) still had issues/flaws (but could be worked around by disabling some things). It’s important not to “partially” spoof anything. Think of locales, date formats, time zones, screen res, language, platform, 32 vs 64 bit, OS. IMO, RAS hadn’t matured enough. I did limit it to just UA spoofing and just to the last 10 versions of FF(32bit) on Windows7. At the time, for just this, it seemed overkill. And I think, from memory, it didn’t have a whitelist for each specific spoof (UA, screen res, etc)

  4. Pants said on March 21, 2016 at 4:06 pm
    Reply

    The user agent requires spoofing in both headers and javascript ( you can test at https://whoer.net/ where the two methods’ results are shown under the “Browser” section: Headers and Javascript. ).

    Whatever add-on you use (UAControl, Random Agent Spoofer, whatever), you can also use User-Agent JS Fixer ( https://addons.mozilla.org/en-US/firefox/addon/user-agent-js-fixer/ ). No buttons, no config, works with all your site whitelists etc: “All it does is to redefine the User-Agent for JavaScript code (navigator.userAgent) using the same string that was sent on the HTTP header”

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.