确定用户是否在服务器操作系统上
我需要一种方法来确定用户是否在服务器操作系统上或正在使用终端连接(远程桌面)来查看站点。我需要这个来关闭所有动画和其他东西。
我能做的最好的事情就是从 UserAgent 确定操作系统,但 Windows 7 和 Windows Server 2008 之间没有区别。我也可以检查用户计算机上的颜色深度。
有更好的方法吗?
I need a way to determine if user is on server OS or is using terminal connection (remote desktop) to view the site. I need this to turn off all animations and other stuff.
The best i can do is to determine os from UserAgent, but there is no difference between Windows 7 and Windows Server 2008. I can check color depth on user machine also.
Is there a better way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的方法可能不是尝试自动检测处理某些视觉效果的能力较差的环境,而是让用户可以通过页面上某处的选项切换到资源密集程度较低的模式。
大多数服务器和服务器远程桌面用户比典型桌面用户更高级,并且更经常寻求可能的性能改进(每当我通过远程桌面连接到计算机时,我个人本能地关闭所有视觉效果),因此他们愿意接受该选项并明智地放置它不会分散其他人的注意力。
如果您确实想检测用户代理的设置,您可能可以尝试以某种方式尝试测量您所编写的 JavaScript 性能或颜色深度。但如果可以的话我真的会避免这种情况。
The best way probably is not try to auto-detect the environment that is less capable of handling some visual effects but give the user the possibility to switch into a less resource-intensive mode with an option somewhere on the page.
Most of the server & remote desktop users are more advanced than typical desktop users and more often looking for possible performance improvements (I personally instinctively turn off all the visual effects whenever I am connecting via remote desktop to a machine), so they will be willing to accept the option and placed wisely it won't distract the others.
In case you really want to detect user agent's setup, you could probably somehow try to measure javascript's performance or color depth as you've written. But I would really avoid this if you can.