Navigator:contacts 属性

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

安全上下文: 此项功能仅在一些支持的浏览器安全上下文(HTTPS)中可用。

Navigator 接口的只读属性 contacts 返回一个 ContactsManager 接口,该接口允许用户从他们的联系人列表中选择条目,并与网站或应用程序共享所选条目的有限详细信息。

一个 ContactsManager 对象。两次连续调用返回同一个对象。

示例

以下代码检查是否支持联系人选择器 API。

js
const supported = "contacts" in navigator && "ContactsManager" in window;

规范

Specification
Contact Picker API
# dom-navigator-contacts

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
contacts
Experimental

Legend

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

Full support
Full support
Partial support
Partial support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.
User must explicitly enable this feature.

参见