Tabs & Windows

Tab Count

How many tabs the browser has, which is not the same as how many GPAL opened. A tab can close itself, and that is exactly what a browser does with a tab whose first navigation turns into a download: the tab appears, the file starts, the tab goes. Counting is how a download-in-a-tab knows the difference between a page that is still loading and a tab that has already done its job. Answers with the number of tabs open, or zero when the extension could not say. No parameters.

Examples

MagicHelper: MagicHelper utility library

int tabs = browser.MagicHelper.TabCount();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.TabCount();

REST Client: Direct REST/HTTP client

browser.OttoMagicClient.WithEndpoint(ApiEndpoint.TabCount).Execute<int>();

💬 Ask GPAL