How to check website viewer's operating system

2019-04-30 11:14发布

I'm running Ubuntu 8.04 and I recently received the following error when visiting a website:

Please return to www.site.com with a computer running Windows 98, 2000, Me, NT, or XP.

  1. How does the website know which OS I'm running? Is it only via javascript or is there OS information in the request headers as well?

  2. Is there a way for me to bypass this check or "pretend" to be using Windows so that I can access the website even though I'm running an unsupported OS?

7条回答
成全新的幸福
2楼-- · 2019-04-30 11:38

You can use navigator.platform in JavaScript:

var OS = navigator.platform;
alert(OS);

That way you don't have to worry about parsing the user agent.

查看更多
登录 后发表回答