window.innerWidth in Chrome’s device mode
window.innerWidth and innerHeight return the dimensions of the visual viewport. In desktop browsers, this is generally the browser’s window dimensions. On mobile the situation is a bit more complicated because of pinch zoom. When you load a page without a <meta name=”viewport”> tag, a default layout width is used (e.g. Chrome uses 980px). When the … Read more