Window & Viewport

Get Window Rectangle

Provides viewport and outer window dimensions when running in the top-level browsing context.

Examples

GPAL Fluent: High-level fluent C# API

//Answered by whichever engine is driving, so a workflow does not have to know which one that is. The rectangle is the whole window in screen coordinates, chrome included.

browser.GetWindowRectangle(out Rectangle window);

MagicHelper: MagicHelper utility library

browser.MagicHelper.GetWindowRectangle();

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.GetWindowRectangle().Execute<Rectangle>();

Puppeteer Communicator: Low-level communicator

//Asked of the browser rather than the page, through Browser.getWindowForTarget and Browser.getWindowBounds, so it needs no JavaScript and answers while a page is still loading.

await browser.PuppeteerCommunicator.GetWindowRectangle(string sessionId);

REST Client: Direct REST/HTTP client

browser.OttoMagicClient.WithEndpoint(ApiEndpoint.GetWindowRectangle).Execute();

💬 Ask GPAL