src code
document.viewport.getWidth() → Number
Returns the width of the viewport.
Equivalent to calling document.viewport.getDimensions().width.
document.viewport.getDimensions().width