3

Since packaged apps can run on different platforms, is there any way to distinguish between Windows and Mac ?

I would like to show some help vis-à-vis keyboard shortcuts and being able to detect the OS would help in for example showing Command ⌘</kbd>C or CtrlC accordingly.

4

2 回答 2

3

您还可以使用新的chrome.runtime.getPlatformInfoAPI(https://developer.chrome.com/apps/runtime.html#method-getPlatformInfo,自Chrome 29起可用)。

于 2013-08-11T01:38:01.400 回答
2

您可以window.navigator在 JS 中使用。通常,这将包含您正在寻找的信息。可能在 window.navigator.platform 中。

于 2013-08-09T18:37:18.773 回答