navigator.windowControlsOverlay is the experimental entry point to the Window Controls Overlay API for desktop Progressive Web Apps. Learn visible, getTitlebarAreaRect(), geometrychange, the manifest opt-in, five examples, and try-it labs.
01
Kind
Read-only property
02
Returns
WindowControlsOverlay
03
Status
Experimental
04
Context
Secure (HTTPS)
05
Target
Desktop PWAs
06
Key method
getTitlebarAreaRect()
Fundamentals
Introduction
Installed desktop apps usually have a title bar with minimize / maximize / close buttons. Progressive Web Apps can look more “native” by drawing their own UI in that space — logo, tabs, search — while the OS still owns the window buttons.
That feature is the Window Controls Overlay. After you opt in from the web app manifest, navigator.windowControlsOverlay tells your page the geometry of the free title bar area so your custom chrome does not collide with the system controls.
💡
Manifest opt-in
MDN: use the window-controls-overlay value in display_override. That hides the default title bar and gives the app access to the full window area.
Concept
Understanding the windowControlsOverlay Property
The property itself is only the entry point. The useful pieces live on the returned WindowControlsOverlay object.
visible — boolean: is the window controls overlay visible?
getTitlebarAreaRect() — returns a DOMRect for the title bar region.
geometrychange — event when the title bar geometry (or visibility) changes.
Secure context — HTTPS / localhost required.
Desktop PWA focus — most useful after install + manifest opt-in.
Limited support — feature-detect; keep a fallback layout.
Foundation
📝 Syntax
General form of the property:
JavaScript
navigator.windowControlsOverlay
Value
A WindowControlsOverlay object (when supported).
Common patterns
JavaScript
// MDN-style feature detect + title bar rect
if ("windowControlsOverlay" in navigator) {
const rect = navigator.windowControlsOverlay.getTitlebarAreaRect();
// Do something with the title bar area rectangle.
} else {
// The Window Controls Overlay feature is not available.
}
// Listen for geometry changes (MDN):
if ("windowControlsOverlay" in navigator) {
navigator.windowControlsOverlay.addEventListener("geometrychange", (event) => {
if (event.visible) {
const rect = event.titlebarAreaRect;
// Layout custom title bar UI using rect
}
});
}
Manifest sketch (for installed desktop PWAs)
JavaScript
{
"name": "My Desktop PWA",
"display": "standalone",
"display_override": ["window-controls-overlay"]
}
Cheat Sheet
⚡ Quick Reference
Goal
Code
Get overlay API
navigator.windowControlsOverlay
Feature detect
"windowControlsOverlay" in navigator
Is overlay visible?
navigator.windowControlsOverlay.visible
Title bar rectangle
getTitlebarAreaRect()
Listen for changes
addEventListener("geometrychange", …)
Secure context?
window.isSecureContext
Manifest opt-in
display_override: ["window-controls-overlay"]
Snapshot
🔍 At a Glance
Four facts to remember about navigator.windowControlsOverlay.
Returns
WindowControlsOverlay
Title bar API
Status
Experimental
Not Baseline
Context
HTTPS
Secure required
Best in
Desktop PWA
Installed + opt-in
Compare
📋 Default Title Bar vs Window Controls Overlay
Default desktop window
With Window Controls Overlay
Title bar
OS / browser draws it
Hidden; app can draw custom UI
Window buttons
In the system title bar
Still OS-owned; overlay leaves a safe region
How to enable
Nothing special
Manifest display_override + install
JS helper
N/A
navigator.windowControlsOverlay
Hands-On
Examples Gallery
Examples follow MDN navigator.windowControlsOverlay patterns. Prefer Try It Yourself — in a normal browser tab the API is often missing or visible is false until you run an installed desktop PWA with the overlay enabled.
📚 Getting Started
Detect the API and check whether the overlay is visible.
Example 1 — Feature Detection
MDN-style support check before using title bar geometry.
windowControlsOverlay not supported
(or "Listening for geometrychange" then rect updates when resizing a supporting PWA)
How It Works
Window resize and display changes can move the safe title bar region — listen and re-layout.
Example 5 — Apply Title Bar Padding
Beginner layout helper: set CSS variables from the title bar rect when visible.
JavaScript
function applyTitlebarLayout() {
if (!("windowControlsOverlay" in navigator)) {
return "API missing — keep a normal header";
}
const wco = navigator.windowControlsOverlay;
if (!wco.visible) {
return "Overlay not visible — keep a normal header";
}
const rect = wco.getTitlebarAreaRect();
document.documentElement.style.setProperty("--titlebar-x", rect.x + "px");
document.documentElement.style.setProperty("--titlebar-w", rect.width + "px");
document.documentElement.style.setProperty("--titlebar-h", rect.height + "px");
return "CSS vars set from title bar rect";
}
console.log(applyTitlebarLayout());
navigator.windowControlsOverlay belongs to the experimental Window Controls Overlay API and is not Baseline. It targets installed desktop PWAs with a manifest opt-in. Always feature-detect, use HTTPS, and keep a normal header fallback.
✓ Experimental · Not Baseline
Navigator.windowControlsOverlay
WindowControlsOverlay entry point — title bar geometry for desktop PWAs that hide the default title bar.
LimitedExperimental
Google ChromeDesktop PWA / Chromium Window Controls Overlay
Limited
Microsoft EdgeDesktop PWA / follow Chromium support
Limited
OperaFollow Chromium desktop PWA support
Limited
Mozilla FirefoxTypically unavailable — feature-detect
Unavailable
Apple SafariTypically unavailable — feature-detect
Unavailable
Internet ExplorerNo windowControlsOverlay support
Unavailable
windowControlsOverlayLimited
Bottom line: Detect navigator.windowControlsOverlay, opt in with display_override, measure getTitlebarAreaRect when visible, and never require the API for core navigation chrome.
Wrap Up
Conclusion
navigator.windowControlsOverlay is the experimental entry point for desktop PWA title bar geometry. Opt in from the manifest, measure the free title bar area, listen for geometrychange, and keep a solid fallback when the API is missing.
Feature-detect "windowControlsOverlay" in navigator
Opt in with display_override in the manifest
Use HTTPS / localhost
Layout only when visible is true
Listen for geometrychange on resize
❌ Don’t
Assume Baseline support in every browser
Require the API for core navigation
Draw under the OS window buttons
Ignore secure-context requirements
Assign to navigator.windowControlsOverlay
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about windowControlsOverlay
Experimental desktop PWA title bar geometry — detect, measure, fall back.
5
Core concepts
📄01
Returns
WindowControlsOverlay
Value
⚡02
Status
Experimental
Limited
🔒03
Context
secure HTTPS
Required
🖥04
Measure
getTitlebarAreaRect
Geometry
🎯05
Opt in
display_override
Manifest
❓ Frequently Asked Questions
A WindowControlsOverlay object. In desktop Progressive Web Apps that opt into Window Controls Overlay, it exposes title bar geometry (getTitlebarAreaRect), a visible flag, and a geometrychange event.
MDN marks the WindowControlsOverlay interface Experimental and Limited availability (not Baseline). It is not Deprecated or Non-standard. Always feature-detect and keep a fallback title bar layout.
Yes. MDN lists it as a secure-context feature (HTTPS or localhost) in supporting browsers.
In your web app manifest, use display_override with the value window-controls-overlay (and install the PWA on desktop). That hides the default title bar and gives the app the full window area.
A method that returns a DOMRect describing the size and position of the title bar area so you can place custom UI (logo, tabs, search) without covering the window controls.
Usually the API is missing or the overlay is not visible outside an installed desktop PWA with the manifest opt-in. Always feature-detect and design a fallback.
Did you know?
Window Controls Overlay does not remove the minimize / maximize / close buttons. It hides the default title bar chrome and tells your page where the safe title bar rectangle is so your custom UI can sit beside those OS controls.