mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-18 11:06:19 +00:00
git-subtree-dir: packages/browseros-agent git-subtree-mainline:8f148d0918git-subtree-split:90bd4be300
25 lines
666 B
TypeScript
25 lines
666 B
TypeScript
/**
|
|
* @public
|
|
*/
|
|
export async function openSidePanel(
|
|
tabId: number,
|
|
): Promise<{ opened: boolean }> {
|
|
// @ts-expect-error browserosIsOpen is a BrowserOS-specific API
|
|
const isAlreadyOpen = await chrome.sidePanel.browserosIsOpen({ tabId })
|
|
if (isAlreadyOpen) {
|
|
return { opened: true }
|
|
}
|
|
// @ts-expect-error browserosToggle is a BrowserOS-specific API
|
|
return await chrome.sidePanel.browserosToggle({ tabId })
|
|
}
|
|
|
|
/**
|
|
* @public
|
|
*/
|
|
export async function toggleSidePanel(
|
|
tabId: number,
|
|
): Promise<{ opened: boolean }> {
|
|
// @ts-expect-error browserosToggle is a BrowserOS-specific API
|
|
return await chrome.sidePanel.browserosToggle({ tabId })
|
|
}
|