MDN will be in maintenance mode on Wednesday September 20th, starting at 10 AM Pacific / 5 PM UTC, for about 1 hour.

附加组件

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

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

值类型

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

"mac"
表示底层操作系统是 Mac OS X.
"win"
表示底层操作系统是 Windows.
"android"
表示底层操作系统是 Android.
"cros"
表示底层操作系统是 Chrome OS.
"linux"
表示底层操作系统是 Linux.
"openbsd"
表示底层操作系统是 Open/FreeBSD.

浏览器兼容性

Chrome Edge Firefox Firefox for Android Opera
Basic support Yes No 45.0 48.0 33

Acknowledgements

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

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

文档标签和贡献者

 此页面的贡献者: taadis
 最后编辑者: taadis,