Firefox – Change User Agent Permanently Without Add-ons

firefoxuser-agentwindows

According this article How to reset the default user agent on Firefox, the procedure for changing user agent is to add a string value with general.useragent.override in about:config page.

But when I add the user agent string with general.useragent.override, it shows modified at the status column. The modified status preferences can be easily changed. While the status is default for other in-build preferences.

How can I change the user agent so that it shows default status? Or How can I change user agent permanently?

Modified_Firefox_Useragent

Best Answer

According to this article Deploying Firefox in an enterprise environment, first create a autoconfig.js file in defaults\perf folder Firefox program directory i.e. C:\Program Files\Firefox\defaults\pref. Write the following lines in that file.

// Must start with a comment!
pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);

Then create mozilla.cfg file in Firefox program directory i.e. C:\Program Files\Mozilla Firefox and write the following lines in that file. lockPref will lock that preference and defaultPref will make it default. Put any user agent in place of My_User_Agent.

// Must start with a comment!
lockPref("general.useragent.override", "My_User_Agent");

Now restart Firefox to apply that change.

Locked_User_Agent

Related Question