为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

I need to change Operating System detected via JavaScript

  • 6 个回答
  • 1 人有此问题
  • 285 次查看
  • 最后回复者为 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