Javascript 通过网站获取操作系统级信息

Javascript 通过网站获取操作系统级信息,javascript,python,php,browser,operating-system,Javascript,Python,Php,Browser,Operating System,我需要获得某些操作系统级别的信息。我不能在客户端机器上安装任何东西,我只能选择在客户端机器上的浏览器中打开URL。如果可能的话,我需要得到以下信息 获取操作系统版本 他们运行Windows Update了吗 任何挂起的重新启动等待(从软件安装)都会导致SentryBay安装出现问题 音频设置 默认录制和播放设备的名称 这些设备中的任何一个是否已静音 这些设备的卷是否位于0 中央处理器 公羊 应仅运行Defender(适用于PC) 他们在使用无线网络吗 PC上运行的是什么(如果CPU使用率

我需要获得某些操作系统级别的信息。我不能在客户端机器上安装任何东西,我只能选择在客户端机器上的浏览器中打开URL。如果可能的话,我需要得到以下信息

  • 获取操作系统版本
  • 他们运行Windows Update了吗
  • 任何挂起的重新启动等待(从软件安装)都会导致SentryBay安装出现问题
  • 音频设置
    • 默认录制和播放设备的名称
    • 这些设备中的任何一个是否已静音
    • 这些设备的卷是否位于0
  • 中央处理器
  • 公羊
  • 应仅运行Defender(适用于PC)
  • 他们在使用无线网络吗
  • PC上运行的是什么(如果CPU使用率很高,可能需要关闭或卸载软件)
  • 安全模式需要关闭
该网站可以用JS、PHP、Python等任何语言编写代码


谢谢。

出于安全考虑,大部分这是不可能的,但是一些浏览器已经实现了可以访问其中一些信息的web API。有一些关于使用API可以访问哪些类型的特定于设备的数据的重要信息,这些API主要是为特定设备设计的


更新:在JavaScript中有关于如何访问操作系统版本的信息。实际上,您可以使用PHP获取设备的操作系统信息。它可以通过以下代码判断用户是否正在使用Windows 7或Windows 8或Windows 10或Android或Mac OS或IOS或更高版本:

<?php

$user_agent = $_SERVER['HTTP_USER_AGENT'];

function getOS() { 

    global $user_agent;

    $os_platform  = "Unknown OS Platform";

    $os_array     = array(
                          '/windows nt 10/i'      =>  'Windows 10',
                          '/windows nt 6.3/i'     =>  'Windows 8.1',
                          '/windows nt 6.2/i'     =>  'Windows 8',
                          '/windows nt 6.1/i'     =>  'Windows 7',
                          '/windows nt 6.0/i'     =>  'Windows Vista',
                          '/windows nt 5.2/i'     =>  'Windows Server 2003/XP x64',
                          '/windows nt 5.1/i'     =>  'Windows XP',
                          '/windows xp/i'         =>  'Windows XP',
                          '/windows nt 5.0/i'     =>  'Windows 2000',
                          '/windows me/i'         =>  'Windows ME',
                          '/win98/i'              =>  'Windows 98',
                          '/win95/i'              =>  'Windows 95',
                          '/win16/i'              =>  'Windows 3.11',
                          '/macintosh|mac os x/i' =>  'Mac OS X',
                          '/mac_powerpc/i'        =>  'Mac OS 9',
                          '/linux/i'              =>  'Linux',
                          '/ubuntu/i'             =>  'Ubuntu',
                          '/iphone/i'             =>  'iPhone',
                          '/ipod/i'               =>  'iPod',
                          '/ipad/i'               =>  'iPad',
                          '/android/i'            =>  'Android',
                          '/blackberry/i'         =>  'BlackBerry',
                          '/webos/i'              =>  'Mobile'
                    );

    foreach ($os_array as $regex => $value)
        if (preg_match($regex, $user_agent))
            $os_platform = $value;

    return $os_platform;
}

$user_os        = getOS();

$device_details = "<strong>Operating System: </strong>".$user_os."";

print_r($device_details);

?>


我当然希望这是不可能的:-)这通常是不可能的,除非您需要Internet Explorer。使用IE,你可以编写一个ActiveX插件来报告这些信息。放弃这些信息将是一个非常糟糕的主意。正如其他人已经提到的,可能会获得一些非常有限的信息,但你不会得到你想要的大部分。谢谢你的评论。我已经知道,大多数项目是不可能的,但我仍然想探索更多的想法。这非常有帮助。谢谢