如何从浏览器中检测用户是否正在远程桌面会话中运行? [英] How to detect, from browser, if user is running in Remote Desktop session?
问题描述
有没有一种方法可以检查浏览器内部(例如javascript)用户是否在远程桌面会话中运行?
如果用户在远程桌面(即终端服务)中运行其浏览器,我想禁用该网站上的动画.
如果这是一个本机应用程序,而不是网站,我可以使用以下方法执行此检查:
//Native code
isRemoteSession = GetSystemMetrics( SM_REMOTESESSION );
或
//Managed Code:
isRemoteSession = System.Windows.Forms.SystemInformation.TerminalServerSession;
浏览器内部是否可以进行类似的检查?
注意:出于讨论的目的,假设我们正在谈论的浏览器是Internet Explorer 8.
更新一项:也许在解决方案
您可以使用以下媒体查询:
@media screen and (prefers-reduced-motion: reduce) { . . . }
这种情况也适用于非RDP会话,但是由于您打算禁用所有动画,因此这种查询可能正是您要查找的. p>
Is there a ways to check inside a browser (e.g. javascript) if the user is running inside a Remote Desktop session?
If the user is running their browser inside a Remote Desktop (i.e. Terminal Services), i want to disable animations on the web-site.
If this were a native application, as opposed to a web-site, i could perform this checking using:
//Native code
isRemoteSession = GetSystemMetrics( SM_REMOTESESSION );
or
//Managed Code:
isRemoteSession = System.Windows.Forms.SystemInformation.TerminalServerSession;
Is there a similar check that can be done inside the browser?
Note: Assume for the purposes of this discussion that the browser we're talking about is Internet Explorer 8.
Update One: Perhaps something in How can you get the terminal service client machine name from javascript?
You can use the following media query:
@media screen and (prefers-reduced-motion: reduce) { . . . }
This condition can also hold for non-RDP sessions, but as your intention is to disable all animations, this type of query is probably exactly what you're looking for.
这篇关于如何从浏览器中检测用户是否正在远程桌面会话中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!