回答

16

最近添加的,可以使用在Chrome的自己的API的getPlatformInfo method

chrome.runtime.getPlatformInfo(function(info) { 
    // Display host OS in the console 
    console.log(info.os); 
}); 
+1

注意,它不會在[內容腳本]工作(https://developer.chrome.com/extensions/content_scripts。 html) – Troggy 2014-02-10 21:48:19

+0

此API只能在後臺腳本中使用。 – 2018-03-09 11:36:40

相關問題