How to detect my browser version and operating system using JavaScript?

后端 未结 10 1070
天命终不由人
天命终不由人 2020-11-22 06:25

I have tried using the code below but it only display results in Chrome and Mozilla not working in IE6.

10条回答
  •  执念已碎
    2020-11-22 07:20

    Code to detect the operating system of an user

    let os = navigator.userAgent.slice(13).split(';')
    os = os[0]
    
    console.log(os)
    
    Windows NT 10.0
    

提交回复
热议问题