MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / parseWindowSize

Function parseWindowSize

lib/helper/Playwright.js:4663–4678  ·  view source on GitHub ↗
(windowSize)

Source from the content-addressed store, hash-verified

4661}
4662
4663function 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

Callers 2

_setConfigMethod · 0.85
targetCreatedHandlerFunction · 0.85

Calls 1

logMethod · 0.80

Tested by

no test coverage detected