Useragent string to only identify the version of Firefox
How can I have my useragent hold only the information identifying my browser as Firefox and it's version? I am aware of the addon that allows me to disguise myself with other browser's useragent, however that is not what I'm looking for specially since the settings reset with every session.
被采纳的解决方案
You can create a new string in about:config called general.useragent.override and set it to what you want to display. You will need to update this every time you update Firefox if you want it to show the correct Firefox version. You can create a new string by right-clicking in about: config and selecting New > String
Be aware that removing parts of the user string can cause some sites that rely on user agent sniffing to not display properly.
定位到答案原位置 👍 0所有回复 (9)
选择的解决方案
You can create a new string in about:config called general.useragent.override and set it to what you want to display. You will need to update this every time you update Firefox if you want it to show the correct Firefox version. You can create a new string by right-clicking in about: config and selecting New > String
Be aware that removing parts of the user string can cause some sites that rely on user agent sniffing to not display properly.
由TonyE于
I see there was this option as well. But I really do not know the structure of useragent what exactly to write as the value. Would you suggest what to wrote for the values I want (i.e. this is Firefox, version x)?
My recommendation is do not change the user agent string. Your user agent string is currently "Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
It does not divulge any private information.
I don't want to reveal my OS. While the system details does say Windows 7, I use Ubuntu usually, and for reasons I don't want to divulge I don't want to reveal anything other than basic browser details.
So is "Firefox/4.o.1" enough or is the Mozilla part necessary.
It is best to keep the Mozilla/5.0 part as some sites will search for that. Not including an OS can also cause some sites to stop working properly.
Personally I do not understand why you would not want to reveal the OS. It is not private information.
Okay, thanks for the input, I learned some new stuff. Now last query; is there any variables I can use to replace the two parts so I don't need to update it on every upgrade?
You will need to update it every time you update Firefox.
You could set that pref in a user.js file, which Firefox reads last - every time Firefox is opened.
You need to change the minor or major Firefox version as you see on the top of the Help > About window after each update in the pref general.useragent.override if you set that pref general.useragent.override to a specific UA.
That pref will always override the full user agent and that is the only way to change the UA in Firefox 4 and later. Other methods are no longer supported.