Detect operating system from Google Chrome Extension

后端 未结 2 1410
别跟我提以往
别跟我提以往 2021-01-11 11:25

I am developing a Chrome extension, and I need to detect which operating system Chrome is running on but i can\'t seem to find any info on how to do it. Please Help. Thank

2条回答
  •  -上瘾入骨i
    2021-01-11 11:48

    You would need to search for OS name and version inside window.navigator.appVersion.

    If you just want to know a platform, see this answer. You can enhance the code by searching for other user agents.

    Here is a detailed list of Chrome user agent strings (click on links to see what they mean).

提交回复
热议问题