UNPKG

@mirawision/chrome-api

Version:

A comprehensive TypeScript library for Chrome Extension API, providing type-safe wrappers and utilities for bookmarks, commands, context menus, cookies, downloads, storage, notifications, runtime, scripting, and side panel functionalities.

26 lines (25 loc) 791 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SidePanel = void 0; /** * A class that provides a type-safe wrapper around Chrome's side panel API. * This class allows you to control the browser's side panel functionality, * including opening the panel and configuring its options. */ class SidePanel { /** * Opens the side panel for a specific tab. * @param tabId - The ID of the tab to open the side panel for */ static open(tabId) { chrome.sidePanel.open({ tabId }); } /** * Sets options for the side panel. * @param options - The options to configure the side panel with */ static setOptions(options) { chrome.sidePanel.setOptions(options); } } exports.SidePanel = SidePanel;