(windowSize)
| 4661 | } |
| 4662 | |
| 4663 | function parseWindowSize(windowSize) { |
| 4664 | if (!windowSize) return { width: 800, height: 600 } |
| 4665 | |
| 4666 | if (windowSize.width && windowSize.height) { |
| 4667 | return { width: parseInt(windowSize.width, 10), height: parseInt(windowSize.height, 10) } |
| 4668 | } |
| 4669 | |
| 4670 | const dimensions = windowSize.split('x') |
| 4671 | if (dimensions.length < 2 || windowSize === 'maximize') { |
| 4672 | console.log('Invalid window size, setting window to default values') |
| 4673 | return { width: 800, height: 600 } // invalid size |
| 4674 | } |
| 4675 | const width = parseInt(dimensions[0], 10) |
| 4676 | const height = parseInt(dimensions[1], 10) |
| 4677 | return { width, height } |
| 4678 | } |
| 4679 | |
| 4680 | // List of key values to key definitions |
| 4681 | // https://github.com/puppeteer/puppeteer/blob/v1.20.0/lib/USKeyboardLayout.js |
no test coverage detected