JavaScript - get detailed information about the browser

后端 未结 1 526
心在旅途
心在旅途 2021-02-19 05:10

Basically I\'m looking for something to give me easy access to information like useragentstring.com, but in JS, without me parsing the user agent and looking for each possible b

1条回答
  •  深忆病人
    2021-02-19 05:53

    This should help you, have a look of the values for the following:

    navigator["appCodeName"]
    navigator["appName"]
    navigator["appMinorVersion"]
    navigator["cpuClass"]
    navigator["platform"]
    navigator["plugins"]
    navigator["opsProfile"]
    navigator["userProfile"]
    navigator["systemLanguage"]
    navigator["userLanguage"]
    navigator["appVersion"]
    navigator["userAgent"]
    navigator["onLine"]
    navigator["cookieEnabled"]
    navigator["mimeTypes"]
    
    var x = '';
    for(var p in navigator){
       try {
          x += p + '=' + navigator[p] + "\n";
          console.log(x);
       }
       catch(e) {
           console.error(e);
       }
    }

    0 讨论(0)
提交回复
热议问题