MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / windowSize

Method windowSize

javascript/selenium-webdriver/firefox.js:219–229  ·  view source on GitHub ↗

* Sets the initial window size * * @param {{width: number, height: number}} size The desired window size. * @return {!Options} A self reference. * @throws {TypeError} if width or height is unspecified, not a number, or * less than or equal to 0.

({ width, height })

Source from the content-addressed store, hash-verified

217 * less than or equal to 0.
218 */
219 windowSize({ width, height }) {
220 function checkArg(arg) {
221 if (typeof arg !== 'number' || arg <= 0) {
222 throw TypeError('Arguments must be {width, height} with numbers > 0')
223 }
224 }
225
226 checkArg(width)
227 checkArg(height)
228 return this.addArguments(`--width=${width}`, `--height=${height}`)
229 }
230
231 /**
232 * @param {string} key the preference key.

Callers 1

headless.jsFile · 0.45

Calls 1

addArgumentsMethod · 0.95

Tested by

no test coverage detected