Contacts and Local Fonts

Contacts, Idle Detection and Local Fonts

Three Chromium-only APIs reach into data the operating system owns. Each needs a permission prompt raised from a user gesture, so none can be exercised in an automated browser. navigator.contacts.select() opens the platform's own contact sheet and returns only the entries and properties the user ticked — the page never sees the address book. IdleDetector reports whether the user has stopped interacting and whether the screen is locked, which is how a chat app shows an "away" badge; its threshold must be at least 60000 ms or start() throws TypeError. queryLocalFonts() lists the machine's installed fonts for design tools that need a desktop-style font menu; a denied permission resolves to an empty array instead of throwing, so check length.

The three permission-gated calls (each requires a click and a prompt)JavaScript
const picked = await navigator.contacts.select(['name', 'tel'], { multiple: true });
if (await IdleDetector.requestPermission() === 'granted') {
  const detector = new IdleDetector();
  detector.onchange = () => console.log(detector.userState, detector.screenState);
  await detector.start({ threshold: 60_000 });   // 'active'/'idle', 'locked'/'unlocked'
}
const fonts = await window.queryLocalFonts();    // [{ postscriptName, fullName, family, style }]
Availability of the three OS-facing device APIs
API Entry point Support (September 2026)
Contact Picker navigator.contacts.select() Chrome 1 for Android 80; no desktop build
Idle Detection new IdleDetector() Chrome 94, Edge 114; Mozilla objects
Local Font Access window.queryLocalFonts() Chrome 103, Edge 103, desktop only

Feature-detect and keep a fallback: a typed phone number, a visibilitychange listener, and web fonts (Web Fonts and Variable Fonts) in place of the local font list.