Example 1 — Feature Detection
Check whether the API is exposed before reading geometry.
if ("windowControlsOverlay" in navigator) {
console.log("Window Controls Overlay API available");
console.log("visible:", navigator.windowControlsOverlay.visible);
} else {
console.log("Window Controls Overlay not supported");
}
console.log("secure:", window.isSecureContext); How It Works
- Ask the browser. The
inoperator checks for the property. - Read
visible. Oftenfalsein a normal tab even when the API exists. - Check HTTPS. MDN requires a secure context in supporting browsers.
- Keep a fallback. Limited availability means many environments omit the API.

