获取当前操作系统 - runtime.PlatformOs

获取当前浏览器运行所在的操作系统。

值类型

该值的类型是字符串。可能的值如下:

"mac"

表示底层操作系统是 Mac OS X.

"win"

表示底层操作系统是 Windows.

"android"

表示底层操作系统是 Android.

"cros"

表示底层操作系统是 ChromeOS.

"linux"

表示底层操作系统是 Linux.

"openbsd"

表示底层操作系统是 Open/FreeBSD.

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
PlatformOs

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

备注: This API is based on Chromium's chrome.runtime API. This documentation is derived from runtime.json in the Chromium code.