Web browser window
web-browser-window
npm install web-browser-window --save
`
Use
* getViewportWidth(): number — Returns viewport width. Accounts for page zoom.
* Doesn't work in iOS Safari:
* Doesn't account for page zoom.
* getViewportWidthWithScrollbar(): number — Returns viewport width, including the vertical scrollbar width, if it's shown. Accounts for page zoom.
* Works in iOS Safari:
* Doesn't account for page zoom.
* getViewportHeight(): number — Returns viewport height. Accounts for page zoom.
* Doesn't work in iOS Safari:
* Doesn't account for the top URL bar.
* Doesn't account for the bottom actions bar.
* Doesn't account for page zoom.
* getViewportHeightWithScrollbar(): number — Returns viewport height, including the horizontal scrollbar height, if it's shown. Accounts for page zoom.
* Works in iOS Safari
* getVerticalScrollBarWidth(): number — Returns the width of the vertical scroll bar.
* Doesn't work in iOS Safari
* async scrollIntoView(element: Element, options: object) — Scrolls a DOM Element into view.
* Available options:
* duration — (required) Scroll animation duration.
* async enterFullScreen(element: Element): boolean — Enters fullscreen mode for element. Returns true if succeeded, throws an error otherwise.
* async exitFullScreen(): boolean — Exits fullscreen mode. Returns true if succeeded, throws an error otherwise.
* async toggleFullScreen(element: Element): boolean — Toggles fullscreen mode for element. Returns true if succeeded, throws an error otherwise.
* isFullScreen(): boolean — Tells whether the page is currently in fullscreen mode.
* isFullScreenSupported(): boolean — Tells whether fullscreen mode is supported.
* isFullScreenElement(element: Element): boolean — Tells whether the element is currently in fullscreen mode.
* getFullScreenElement(): Element? — Returns the element that is currently in fullscreen mode.
* onFullScreenChange(listener) — Listens to fullscreen mode enter/exit. The listener doesn't receive any arguments.
Test
`
npm test
``