WindowControlsOverlay

Limited availability

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

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The WindowControlsOverlay interface of the Window Controls Overlay API exposes information about the geometry of the title bar area in desktop Progressive Web Apps, and an event to know whenever it changes. This interface is accessible from Navigator.windowControlsOverlay.

EventTarget WindowControlsOverlay

Instance properties

WindowControlsOverlay.visible Read only Experimental

A Boolean that indicates whether the window controls overlay is visible or not.

Instance methods

WindowControlsOverlay.getTitlebarAreaRect() Experimental

Returns the size and position of the title bar.

Events

Listen to these events using EventTarget.addEventListener() or by assigning an event listener to the relevant oneventname property of this interface.

geometrychange Experimental

Fired when the geometry of the title bar area changes.

Examples

js
if ("windowControlsOverlay" in navigator) {
  navigator.windowControlsOverlay.addEventListener(
    "geometrychange",
    (event) => {
      if (event.visible) {
        const rect = event.titlebarAreaRect;
        // Do something with the coordinates of the title bar area.
      }
    },
  );
}

Specifications

Specification
Window Controls Overlay
# windowcontrolsoverlay-interface

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
WindowControlsOverlay
Experimental
geometrychange event
Experimental
getTitlebarAreaRect
Experimental
visible
Experimental

Legend

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

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.