搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Useragent string to only identify the version of Firefox

  • 9 回覆
  • 5 有這個問題
  • 1 次檢視
  • 最近回覆由 cor-el

more options

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.

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)

more options

選擇的解決方法

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 於 修改

more options

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)?

more options

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.

more options

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.

more options

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.

more options

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?

more options

You will need to update it every time you update Firefox.

more options

You could set that pref in a user.js file, which Firefox reads last - every time Firefox is opened.

http://kb.mozillazine.org/User.js_file

more options

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.