Tabs & Windows

Close Tab

Close a browser tab and return the current active tab information.

Close a browser tab and return the current active tab information.

Closes a tab identified by tab ID, matching URL, or the currently active tab when no request data is provided. After the tab is removed, it retrieves the active tab and sends its ID and URL to the native application.

Examples

GPAL Fluent: High-level fluent C# API

browser.CloseTab() browser.CloseTab(string url) browser.CloseTab(int tabId)

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.CloseTab(); GPAL.MagicHelper.CloseTab(string url); GPAL.MagicHelper.CloseTab(int tabId);

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.CloseTab().Execute(); browser.PuppeteerClient.CloseTab(string url).Execute(); browser.PuppeteerClient.CloseTab(int tabId).Execute();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.CloseTab(string url, string tabId, string sessionId); await browser.PuppeteerCommunicator.CloseTab(string targetId, string sessionId);

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.CloseTab).Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.CloseTab).WithUrl(string url).Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.CloseTab).WithTabId(int tabId).Execute();