WindowControlsOverlayGeometryChangeEvent
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
TheWindowControlsOverlayGeometryChangeEvent interface of theWindow Controls Overlay API is passed togeometrychange when the size or visibility of a desktop Progress Web App's title bar region changes.
In this article
Constructor
WindowControlsOverlayGeometryChangeEvent()ExperimentalCreates a
WindowControlsOverlayGeometryChangeEventevent with the given parameters.
Instance properties
Also inherits properties from its parentEvent.
WindowControlsOverlayGeometryChangeEvent.titlebarAreaRectRead onlyExperimentalA
DOMRectrepresenting the position and size of the title bar region.WindowControlsOverlayGeometryChangeEvent.visibleRead onlyExperimentalABoolean that indicates whether the window controls overlay is visible or not.
Examples
The following example shows how to use aWindowControlsOverlayGeometryChangeEvent instance by adding anevent handler on theNavigator.windowControlsOverlay property, to listen to geometry changes of a PWA's title bar region.
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> |