為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

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

了解更多

I need to change Operating System detected via JavaScript

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

more options

I used browserspy(http://browserspy.dk/os.php) to see my OS detected via JavaScript (OS CPU detected via JavaScript:Windows NT 6.1; WOW66 ).

I don't need to change User Agent. I managed this with add-on. I used this add-on also to change User Agent for JavaScript : https://addons.mozilla.org/en-US/firefox/addon/user-agent-js-fixer/

It is working i checked on browserspy.dk

But i have problem with operating system. If i change my User Agent to Windows NT 6.2, there will be still Windows NT 6.1; WOW66 detected via JavaScript. The User Agent detected via Java Script will be the right one. So the problem is Operating System.

Can you help me with this one? Can i change it somehow?

I used browserspy(http://browserspy.dk/os.php) to see my OS detected via JavaScript (OS CPU detected via JavaScript:Windows NT 6.1; WOW66 ). I don't need to change User Agent. I managed this with add-on. I used this add-on also to change User Agent for JavaScript : https://addons.mozilla.org/en-US/firefox/addon/user-agent-js-fixer/ It is working i checked on browserspy.dk But i have problem with operating system. If i change my User Agent to Windows NT 6.2, there will be still Windows NT 6.1; WOW66 detected via JavaScript. The User Agent detected via Java Script will be the right one. So the problem is Operating System. Can you help me with this one? Can i change it somehow?

被選擇的解決方法

You can create a new string pref on the about:config page.

Type about:config in the location (address) bar and press the "Enter" key to open the about:config page, just like you open a website by typing the URL in the location bar.

  • If you see a warning message then you can confirm that you want to access the about:config page.
  • use the Search bar at the top of the about:config page to locate preferences more easily
  • preferences that have been modified and do not have the default value show as bold (user set)
  • preferences that are user set (bold) can be reset to the default value via the right-click context menu
  • preferences can be changed via the right-click context menu: Modify (String or Integer) or Toggle (Boolean) or by double-clicking the line with the pref
  • preferences can be created via the right-click context menu: New -> String, Integer, Boolean
從原來的回覆中察看解決方案 👍 2

所有回覆 (6)

more options

Note that changing the user agent via an extension probably doesn't change the user agent as detected via JavaScript (navigator.userAgent).
That only affects the user agent as send via the HTTP request headers.

You can check that if you open the Web Console (Web Developer > Web Console;Ctrl+Shift+K) and type navigator. on the command line and select userAgent from the list that opens.

You can set the OS via the general.oscpu.override pref and you can also consider the general.platform.override pref.

more options

changing the useragent this way should also affect navigator.userAgent since firefox 19 (bug #800157).

more options

It doesn't work for me in Firefox 19, but does in the current Firefox 20 beta, so it looks that this didn't land on the Firefox 19 branch.

more options

strange, according to the last few comments this should even have been uplifted to firefox 17 &18...

more options

Well it is working there, i did this with user agent switcher add-on and user agent java script add-on and my user agent is changed. I just need to change my OS. Can you help me with:

You can set the OS via the general.oscpu.override pref and you can also consider the general.platform.override pref.

Where i need to change this, in Web Console? I am sorry but i don't know anything about so please be more specific.

由 lukc18 於 修改

more options

選擇的解決方法

You can create a new string pref on the about:config page.

Type about:config in the location (address) bar and press the "Enter" key to open the about:config page, just like you open a website by typing the URL in the location bar.

  • If you see a warning message then you can confirm that you want to access the about:config page.
  • use the Search bar at the top of the about:config page to locate preferences more easily
  • preferences that have been modified and do not have the default value show as bold (user set)
  • preferences that are user set (bold) can be reset to the default value via the right-click context menu
  • preferences can be changed via the right-click context menu: Modify (String or Integer) or Toggle (Boolean) or by double-clicking the line with the pref
  • preferences can be created via the right-click context menu: New -> String, Integer, Boolean