* 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 })
| 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. |