dom / latest / windowcontrolsoverlay.html /

WindowControlsOverlay

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

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

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

Properties

WindowControlsOverlay.visible Read only

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

Methods

WindowControlsOverlay.getTitlebarAreaRect()

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

Fired when the geometry of the title bar area changes.

Examples

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

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
WindowControlsOverlay
98
98
No
No
84
No
No
No
No
No
No
No
geometrychange_event
98
98
No
No
84
No
No
No
No
No
No
No
getTitlebarAreaRect
98
98
No
No
84
No
No
No
No
No
No
No
visible
98
98
No
No
84
No
No
No
No
No
No
No

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlay