keyboard_backspace wifi_off

Window Management

The Window Management API enables PWAs to read details about the connected displays and place content on specific screens.

This feature is not supported by your browser.

Window management permission was not granted. Allow it in your browser and try again.

// get details for each connected screen, requests permission const screenDetails = await window.getScreenDetails(); // log the details of all connected screens screenDetails.screens.forEach(screen => { console.log({ name: screen.label, resolution: screen.width + ' × ' + screen.height, pixelDensity: screen.devicePixelRatio }); }); const popupWidth = 480; const popupHeight = 360; // iterate over all screens screenDetails.screens.forEach(screen => { // get the top-left corner coordinates of each screen const left = screen.availLeft + Math.round((screen.availWidth - popupWidth) / 2); const top = screen.availTop + Math.round((screen.availHeight - popupHeight) / 2); // place a window on each screen window.open('/src/speaker-notes.html', '_blank', [ 'left=' + left, 'top=' + top, 'width=' + popupWidth, 'height=' + popupHeight ].join(',')); }); // minimize a window window.minimize(); // maximize a window window.maximize(); // make the window non-resizable window.setResizable(false); // make the window resizable window.setResizable(true);

Documentation

Window Management API on MDN

Browser support

Window Management API on caniuse.com

What PWA Can Do Today A showcase of what is possible with Progressive Web Apps today

You are offline, external links cannot be opened.