Источник: https://toster.ru/q/163903
// размер клиентской части окна браузера:
<div class="geshifilter"><pre class="php geshifilter-php" style="font-family:monospace;"><ol> <li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">width<span style="color: #339933;">=</span>document<span style="color: #339933;">.</span>body<span style="color: #339933;">.</span>clientWidth<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// ширина </span> </div></li> <li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">height<span style="color: #339933;">=</span>document<span style="color: #339933;">.</span>body<span style="color: #339933;">.</span>clientHeight<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// высота</span> </div></li> </ol>