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.
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.}},);}