Home › JavaScript Tutorial › JS window API
JS window API
The browser window.
window gives size (innerWidth), location, history, navigator, screen and timers.
Example code
<pre id='o'></pre>
<script>
o.textContent=[innerWidth+' x '+innerHeight,navigator.language,screen.width+' wide screen',matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'].join('\n');
</script>