Skip to main content

getBrowserInfo

codebolt.browser.getBrowserInfo(): Promise<any>
Retrieves browser information like height, width, scroll position of the current page.

Example

// Navigate to a page
await codebolt.browser.goToPage("https://example.com");

// Wait for page to load
await new Promise(resolve => setTimeout(resolve, 2000));

// Get browser information
const browserInfoResult = await codebolt.browser.getBrowserInfo();
console.log('✅ Browser info:', browserInfoResult);

// The browser info contains viewport and scroll data
if (browserInfoResult.success) {
console.log('Browser dimensions and scroll position:', browserInfoResult);
// Example output structure: { height: 800, width: 1200, scrollX: 0, scrollY: 50 }
}