从Google Chrome扩展程序中检测操作系统 [英] Detect operating system from Google Chrome Extension
本文介绍了从Google Chrome扩展程序中检测操作系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发Chrome扩展程序,并且需要检测Chrome正在运行哪个操作系统,但似乎无法找到有关如何操作的任何信息。请帮忙。
谢谢。
解决方案
最近添加的,您可以使用 getPlatformInfo method in Chrome's own API:
< pre $
chrome.runtime.getPlatformInfo(function(info){
//在控制台显示主机操作系统
console.log(info.os);
});
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 You.
解决方案
Recently added, you can use the getPlatformInfo method in Chrome's own API:
chrome.runtime.getPlatformInfo(function(info) {
// Display host OS in the console
console.log(info.os);
});
这篇关于从Google Chrome扩展程序中检测操作系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文