1// SPDX-License-Identifier: AGPL-3.0-or-later2// iOS needs viewport-fit=cover so the layout can extend under the notch and home indicator and3// read env(safe-area-inset-*). Android Chrome must never see it: once a window has gone edge-to-edge4// it does not reliably come back, and the bottom of the layout ends up under the gesture bar.5(function(){6 // Viewport units can resolve stale in an installed Android window, so the app height is measured.7 function fit(){document.documentElement.style.setProperty('--app-height',window.innerHeight+'px');}8 fit();window.addEventListener('resize',fit);window.addEventListener('orientationchange',fit);9 var ios=/iPad|iPhone|iPod/.test(navigator.userAgent)||(navigator.platform==='MacIntel'&&navigator.maxTouchPoints>1);10 if(!ios)return;11 var m=document.querySelector('meta[name=viewport]');12 if(m&&m.content.indexOf('viewport-fit')<0)m.content+=', viewport-fit=cover';13})();