getBrowserInfo
codebolt.browser.getBrowserInfo(): Promise<any>
Retrieves browser information like height, width, scroll position of the current page.
Status
Coming soon...
Example
// Navigate to a page
await codebolt.browser.goToPage("https://example.com")
// Get browser information
const browserInfo = await codebolt.browser.getBrowserInfo()
console.log(browserInfo)
// Example output: { height: 800, width: 1200, scrollX: 0, scrollY: 50 }
Explanation
The codebolt.browser.getBrowserInfo()
method retrieves information about the browser's current state, including dimensions (height and width) and scroll position (scrollX and scrollY) of the current page. This function is useful for responsive design testing, understanding the user's viewport, and for scripts that need to be aware of the browser's dimensions to perform certain actions.