MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / windowSize

Method windowSize

javascript/selenium-webdriver/firefox.js:303–313  ·  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

301 * less than or equal to 0.
302 */
303 windowSize({ width, height }) {
304 function checkArg(arg) {
305 if (typeof arg !== 'number' || arg <= 0) {
306 throw TypeError('Arguments must be {width, height} with numbers > 0')
307 }
308 }
309
310 checkArg(width)
311 checkArg(height)
312 return this.addArguments(`--width=${width}`, `--height=${height}`)
313 }
314
315 /**
316 * Add extensions that should be installed when starting Firefox.

Callers 1

headless.jsFile · 0.45

Calls 1

addArgumentsMethod · 0.95

Tested by

no test coverage detected