How To Change User Agent in Firefox

The user agent of a web browser is a string value which identifies that browser and provides certain system details to servers hosting the websites you visit. Changing the user agent string can be useful in certain scenarios when some web site's functionality is locked down to the specific platform and you need to bypass the restriction. It's not required to mention that changing the user agent can be useful for web developers. Here's how to change the user agent string in Mozilla Firefox. This can be done either with an extension or natively.

Traditionally, the user agent string is used by web developers to optimize their web apps for different devices. This allows developers to differentiate various device classes like tablets, phones, Desktop PCs and laptops, and more. The user agent string can provide web servers some details about the user's operating system, and the browser version.

Firefox as of this writing ships with the new Quantum rendering engine. Also, it features a refined user interface, codenamed "Photon". The browser now comes without support for XUL-based add-ons, so all of the classic add-ons are deprecated and incompatible. See

Must have add-ons for Firefox Quantum

Thanks to the changes made to the engine and the UI, the browser is blazingly fast. The user interface of the app is more responsive and it also starts up noticeably faster. The engine renders web pages much faster than it ever did in the Gecko era.

To change the user agent in Firefox, do the following.

  1. Open a new tab and enter the following text in the address bar:
    about:config

    Confirm that you will be careful if a warning message appears for you.Firefox 57 About Config Confirmation

  2. Enter the following text in the search box:
    general.useragent.overridepreference

    See if you have such a parameter in the search results. Firefox User Agent Preference

  3. If you don't have the value general.useragent.overridepreference, create it yourself. Right-click on the about:config page, and go to New -> String in the context menu.Firefox About Config New Parameter
  4. Name the new value as general.useragent.overridepreference. Hit the Enter key.
  5. Set the value data to the desired user agent.Firefox Change User Agent

Here are some typical user agent strings you can use.

Chrome on Linux:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36

Microsoft Edge:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586

Internet Explorer:

Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko

More can be found on this web site: UserAgentString.com

The general.useragent.overridepreference option applies to every open tab in Firefox and persists until you change or remove it. It remains enabled even if you close or re-open the browser.Firefox Reset User Agent

Change the user agent in Firefox with an extension

If you are switching the user agent in Firefox frequently, you can save a lot of time and use the following extension:

User-Agent Switcher

Navigate to the link above and click on "Add to Firefox".

Firefox User Agent Switcher Extension

This add-on is a revived version of the classic and popular User-Agent Switcher and is written with web-extensions API. The old version can't be used in modern versions of Firefox. This one is compatible with Firefox Quantum.

That's it!

Related articles:

3 thoughts on “How To Change User Agent in Firefox

  1. name

    “general.useragent.overridepreference” did not work for me, but “general.useragent.override”

    Reply
  2. Alex

    Right flag name is “general.useragent.override”

    Reply
  3. User

    This is old information. In new version of FireFox this option is absent.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.