{"id":29702916,"url":"https://github.com/addonbone/browser","last_synced_at":"2025-07-23T13:02:14.029Z","repository":{"id":299891891,"uuid":"1004512039","full_name":"addonbone/browser","owner":"addonbone","description":"A TypeScript promise-based wrapper for Chrome Extension APIs, supporting both Manifest V2 and V3 across Chrome, Opera, Edge, and other Chromium-based browsers.","archived":false,"fork":false,"pushed_at":"2025-07-01T16:19:33.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-01T16:21:23.913Z","etag":null,"topics":["addon","api","chrome","chrome-extension","edge","firefox","opera","safari"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/addonbone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-18T18:34:19.000Z","updated_at":"2025-07-01T16:19:36.000Z","dependencies_parsed_at":"2025-06-18T21:21:46.369Z","dependency_job_id":"12fd6d8d-04a7-4d97-b09c-903d2de9357a","html_url":"https://github.com/addonbone/browser","commit_stats":null,"previous_names":["addonbone/browser"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/addonbone/browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addonbone%2Fbrowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addonbone%2Fbrowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addonbone%2Fbrowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addonbone%2Fbrowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/addonbone","download_url":"https://codeload.github.com/addonbone/browser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addonbone%2Fbrowser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266682532,"owners_count":23967827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","api","chrome","chrome-extension","edge","firefox","opera","safari"],"created_at":"2025-07-23T13:01:20.790Z","updated_at":"2025-07-23T13:02:13.981Z","avatar_url":"https://github.com/addonbone.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @adnbn/browser\n\n[![npm version](https://img.shields.io/npm/v/@adnbn/browser.svg)](https://www.npmjs.com/package/@adnbn/browser)\n[![npm downloads](https://img.shields.io/npm/dm/@adnbn/browser.svg)](https://www.npmjs.com/package/@adnbn/browser)\n\nA TypeScript promise-based wrapper for Chrome Extension APIs, supporting both Manifest V2 and V3 across Chrome, Opera, Edge, and other Chromium-based browsers.\n\n## Installation\n\n```bash\nnpm install @adnbn/browser\n```\n\n## Supported Chrome APIs\n\n- [action](#action)\n- [alarms](#alarms)\n- [audio](#audio)\n- [browsingData](#browsingdata)\n- [commands](#commands)\n- [contextMenus](#contextmenus)\n- [cookies](#cookies)\n- [documentScan](#documentscan)\n- [downloads](#downloads)\n- [extension](#extension)\n- [fileBrowserHandler](#filebrowserhandler)\n- [history](#history)\n- [i18n](#i18n)\n- [idle](#idle)\n- [management](#management)\n- [notifications](#notifications)\n- [offscreen](#offscreen)\n- [permissions](#permissions)\n- [runtime](#runtime)\n- [scripting](#scripting)\n- [sidebar](#sidebar)\n- [tabCapture](#tabcapture)\n- [tabs](#tabs)\n- [userScripts](#userscripts)\n- [webNavigation](#webnavigation)\n- [webRequest](#webrequest)\n\n\u003ca name=\"action\"\u003e\u003c/a\u003e\n\n## action\n\n**Documentation:** [Chrome Action API](https://developer.chrome.com/docs/extensions/reference/action)\n\nA unified interface to the Chrome `action` API (`chrome.action` in Manifest V3, `chrome.browserAction` in Manifest V2), with Promise-based methods.\n\n### Methods\n\n- [disableAction(tabId)](#disableAction)\n- [enableAction(tabId)](#enableAction)\n- [getBadgeBgColor(tabId)](#getBadgeBgColor)\n- [getBadgeText(tabId)](#getBadgeText)\n- [getBadgeTextColor(tabId)](#getBadgeTextColor) [MV3]\n- [getActionPopup(tabId)](#getActionPopup)\n- [getActionTitle(tabId)](#getActionTitle)\n- [getActionUserSetting()](#getActionUserSetting) [MV3]\n- [isActionEnabled(tabId)](#isActionEnabled)\n- [openActionPopup(windowId)](#openActionPopup) [MV3]\n- [setBadgeBgColor(color, tabId)](#setBadgeBgColor)\n- [setBadgeText(text, tabId)](#setBadgeText)\n- [setBadgeTextColor(color, tabId)](#setBadgeTextColor) [MV3]\n- [setActionIcon(details)](#setActionIcon)\n- [setActionPopup(popup, tabId)](#setActionPopup)\n- [setActionTitle(title, tabId)](#setActionTitle)\n- [getDefaultPopup()](#getDefaultPopup)\n- [clearBadgeText(tabId)](#clearBadgeText)\n\n### Events\n\n- [onActionClicked(callback)](#onActionClicked)\n- [onActionUserSettingsChanged(callback)](#onActionUserSettingsChanged) [MV3]\n\n\u003ca name=\"disableAction\"\u003e\u003c/a\u003e\n\n### disableAction\n\n```\ndisableAction(tabId: number): Promise\u003cvoid\u003e\n```\n\nDisables the extension action for the specified tab. Falls back to `chrome.browserAction.disable` in Manifest V2.\n\n\u003ca name=\"enableAction\"\u003e\u003c/a\u003e\n\n### enableAction\n\n```\nenableAction(tabId: number): Promise\u003cvoid\u003e\n```\n\nEnables the extension action for the specified tab. Falls back to `chrome.browserAction.enable` in Manifest V2.\n\n\u003ca name=\"getBadgeBgColor\"\u003e\u003c/a\u003e\n\n### getBadgeBgColor\n\n```\ngetBadgeBgColor(tabId?: number): Promise\u003c[number, number, number, number]\u003e\n```\n\nRetrieves the badge background color for a given tab.\n\n\u003ca name=\"getBadgeText\"\u003e\u003c/a\u003e\n\n### getBadgeText\n\n```\ngetBadgeText(tabId?: number): Promise\u003cstring\u003e\n```\n\nRetrieves the badge text for a given tab.\n\n\u003ca name=\"getBadgeTextColor\"\u003e\u003c/a\u003e\n\n### getBadgeTextColor [MV3]\n\n```\ngetBadgeTextColor(tabId?: number): Promise\u003c[number, number, number, number]\u003e\n```\n\nRetrieves the badge text color for a given tab (Manifest V3 only).\n\n\u003ca name=\"getActionPopup\"\u003e\u003c/a\u003e\n\n### getActionPopup\n\n```\ngetActionPopup(tabId?: number): Promise\u003cstring\u003e\n```\n\nRetrieves the popup URL set for the action in a given tab.\n\n\u003ca name=\"getActionTitle\"\u003e\u003c/a\u003e\n\n### getActionTitle\n\n```\ngetActionTitle(tabId?: number): Promise\u003cstring\u003e\n```\n\nRetrieves the title set for the action in a given tab.\n\n\u003ca name=\"getActionUserSetting\"\u003e\u003c/a\u003e\n\n### getActionUserSetting [MV3]\n\n```\ngetActionUserSetting(): Promise\u003cchrome.action.UserSettings\u003e\n```\n\nRetrieves the user settings for the action (Manifest V3 only).\n\n\u003ca name=\"isActionEnabled\"\u003e\u003c/a\u003e\n\n### isActionEnabled\n\n```\nisActionEnabled(tabId: number): Promise\u003cboolean\u003e\n```\n\nChecks whether the action is enabled for the specified tab.\n\n\u003ca name=\"openActionPopup\"\u003e\u003c/a\u003e\n\n### openActionPopup [MV3]\n\n```\nopenActionPopup(windowId?: number): Promise\u003cvoid\u003e\n```\n\nProgrammatically opens the action popup (Manifest V3 only).\n\n\u003ca name=\"setBadgeBgColor\"\u003e\u003c/a\u003e\n\n### setBadgeBgColor\n\n```\nsetBadgeBgColor(color: string | [number, number, number, number], tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the badge background color for a given tab.\n\n\u003ca name=\"setBadgeText\"\u003e\u003c/a\u003e\n\n### setBadgeText\n\n```\nsetBadgeText(text: string | number, tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the badge text for a given tab.\n\n\u003ca name=\"setBadgeTextColor\"\u003e\u003c/a\u003e\n\n### setBadgeTextColor [MV3]\n\n```\nsetBadgeTextColor(color: string | [number, number, number, number], tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the badge text color for a given tab (Manifest V3 only).\n\n\u003ca name=\"setActionIcon\"\u003e\u003c/a\u003e\n\n### setActionIcon\n\n```\nsetActionIcon(details: chrome.action.TabIconDetails): Promise\u003cvoid\u003e\n```\n\nSets the action icon for a tab or globally.\n\n\u003ca name=\"setActionPopup\"\u003e\u003c/a\u003e\n\n### setActionPopup\n\n```\nsetActionPopup(popup: string, tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the popup URL for the action in a given tab.\n\n\u003ca name=\"setActionTitle\"\u003e\u003c/a\u003e\n\n### setActionTitle\n\n```\nsetActionTitle(title: string, tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the title for the action in a given tab.\n\n\u003ca name=\"getDefaultPopup\"\u003e\u003c/a\u003e\n\n### getDefaultPopup\n\n```\ngetDefaultPopup(): string\n```\n\nReturns the default popup URL from the manifest (`action.default_popup` in MV3 or `browser_action.default_popup` in MV2).\n\n\u003ca name=\"clearBadgeText\"\u003e\u003c/a\u003e\n\n### clearBadgeText\n\n```\nclearBadgeText(tabId?: number): Promise\u003cvoid\u003e\n```\n\nClears the badge text for a given tab.\n\n\u003ca name=\"onActionClicked\"\u003e\u003c/a\u003e\n\n### onActionClicked\n\n```\nonActionClicked(callback: (tab: chrome.tabs.Tab) =\u003e void): () =\u003e void\n```\n\nAdds a listener for the action clicked event.\n\n\u003ca name=\"onActionUserSettingsChanged\"\u003e\u003c/a\u003e\n\n### onActionUserSettingsChanged [MV3]\n\n```\nonActionUserSettingsChanged(callback: (settings: chrome.action.UserSettings) =\u003e void): () =\u003e void\n```\n\nAdds a listener for user settings changes on the action (Manifest V3 only).\n\n\u003ca name=\"alarms\"\u003e\u003c/a\u003e\n\n## alarms\n\n**Documentation:** [Chrome Alarms API](https://developer.chrome.com/docs/extensions/reference/alarms)\n\nA promise-based wrapper for the Chrome `alarms` API.\n\n### Methods\n\n- [clearAlarm(name)](#clearAlarm)\n- [clearAllAlarm()](#clearAllAlarm)\n- [createAlarm(name, info)](#createAlarm)\n- [getAlarm(name)](#getAlarm)\n- [getAllAlarm()](#getAllAlarm)\n\n### Events\n\n- [onAlarm(callback)](#onAlarm)\n\n\u003ca name=\"clearAlarm\"\u003e\u003c/a\u003e\n\n### clearAlarm\n\n```\nclearAlarm(name: string): Promise\u003cboolean\u003e\n```\n\nClears the alarm with the specified name, returning true if an existing alarm was found and cleared.\n\n\u003ca name=\"clearAllAlarm\"\u003e\u003c/a\u003e\n\n### clearAllAlarm\n\n```\nclearAllAlarm(): Promise\u003cboolean\u003e\n```\n\nClears all alarms, returning true if any alarms were found and cleared.\n\n\u003ca name=\"createAlarm\"\u003e\u003c/a\u003e\n\n### createAlarm\n\n```\ncreateAlarm(name: string, info: chrome.alarms.AlarmCreateInfo): Promise\u003cvoid\u003e\n```\n\nCreates a new alarm or updates an existing one with the given name and scheduling options.\n\n\u003ca name=\"getAlarm\"\u003e\u003c/a\u003e\n\n### getAlarm\n\n```\ngetAlarm(name: string): Promise\u003cchrome.alarms.Alarm\u003e\n```\n\nRetrieves details for the alarm with the specified name.\n\n\u003ca name=\"getAllAlarm\"\u003e\u003c/a\u003e\n\n### getAllAlarm\n\n```\ngetAllAlarm(): Promise\u003cchrome.alarms.Alarm[]\u003e\n```\n\nRetrieves all set alarms.\n\n\u003ca name=\"onAlarm\"\u003e\u003c/a\u003e\n\n### onAlarm\n\n```\nonAlarm(callback: (alarm: chrome.alarms.Alarm) =\u003e void): () =\u003e void\n```\n\nAdds a listener that triggers when an alarm goes off.\n\n\u003ca name=\"audio\"\u003e\u003c/a\u003e\n\n## audio\n\n**Documentation:** [Chrome Audio API](https://developer.chrome.com/docs/extensions/reference/audio)\n\nA promise-based wrapper for the Chrome `audio` API.\n\n### Methods\n\n- [getAudioDevices(filter)](#getAudioDevices)\n- [getAudioMute(streamType)](#getAudioMute)\n- [setAudioActiveDevices(ids)](#setAudioActiveDevices)\n- [setAudioMute(streamType, isMuted)](#setAudioMute)\n- [setAudioProperties(id, properties)](#setAudioProperties)\n\n### Events\n\n- [onAudioDeviceListChanged(callback)](#onAudioDeviceListChanged)\n- [onAudioLevelChanged(callback)](#onAudioLevelChanged)\n- [onAudioMuteChanged(callback)](#onAudioMuteChanged)\n\n\u003ca name=\"getAudioDevices\"\u003e\u003c/a\u003e\n\n### getAudioDevices\n\n```\ngetAudioDevices(filter?: chrome.audio.DeviceFilter): Promise\u003cchrome.audio.AudioDeviceInfo[]\u003e\n```\n\nRetrieves the list of available audio devices, optionally filtered.\n\n\u003ca name=\"getAudioMute\"\u003e\u003c/a\u003e\n\n### getAudioMute\n\n```\ngetAudioMute(streamType: chrome.audio.StreamType): Promise\u003cboolean\u003e\n```\n\nRetrieves the mute state of the specified audio stream.\n\n\u003ca name=\"setAudioActiveDevices\"\u003e\u003c/a\u003e\n\n### setAudioActiveDevices\n\n```\nsetAudioActiveDevices(ids?: chrome.audio.DeviceIdLists): Promise\u003cvoid\u003e\n```\n\nSets the list of active audio devices.\n\n\u003ca name=\"setAudioMute\"\u003e\u003c/a\u003e\n\n### setAudioMute\n\n```\nsetAudioMute(streamType: chrome.audio.StreamType, isMuted: boolean): Promise\u003cvoid\u003e\n```\n\nSets the mute state for the specified audio stream.\n\n\u003ca name=\"setAudioProperties\"\u003e\u003c/a\u003e\n\n### setAudioProperties\n\n```\nsetAudioProperties(id: string, properties?: chrome.audio.DeviceProperties): Promise\u003cvoid\u003e\n```\n\nUpdates properties for the specified audio device.\n\n\u003ca name=\"onAudioDeviceListChanged\"\u003e\u003c/a\u003e\n\n### onAudioDeviceListChanged\n\n```\nonAudioDeviceListChanged(callback: () =\u003e void): () =\u003e void\n```\n\nAdds a listener for changes in the list of audio devices.\n\n\u003ca name=\"onAudioLevelChanged\"\u003e\u003c/a\u003e\n\n### onAudioLevelChanged\n\n```\nonAudioLevelChanged(callback: (level: number) =\u003e void): () =\u003e void\n```\n\nAdds a listener for changes in audio level.\n\n\u003ca name=\"onAudioMuteChanged\"\u003e\u003c/a\u003e\n\n### onAudioMuteChanged\n\n```\nonAudioMuteChanged(callback: (isMuted: boolean) =\u003e void): () =\u003e void\n```\n\nAdds a listener for changes in audio mute state.\n\n\u003ca name=\"browsingData\"\u003e\u003c/a\u003e\n\n## browsingData\n\n**Documentation:** [Chrome Browsing Data API](https://developer.chrome.com/docs/extensions/reference/browsingData)\n\nA promise-based wrapper for the Chrome `browsingData` API.\n\n### Methods\n\n- [removeBrowsingData(options, dataToRemove)](#removeBrowsingData)\n- [removeAppcacheData(options)](#removeAppcacheData)\n- [removeCacheData(options)](#removeCacheData)\n- [removeCacheStorageData(options)](#removeCacheStorageData)\n- [removeCookiesData(options)](#removeCookiesData)\n- [removeDownloadsData(options)](#removeDownloadsData)\n- [removeFileSystemsData(options)](#removeFileSystemsData)\n- [removeFormData(options)](#removeFormData)\n- [removeHistoryData(options)](#removeHistoryData)\n- [removeIndexedDBData(options)](#removeIndexedDBData)\n- [removeLocalStorageData(options)](#removeLocalStorageData)\n- [removePasswordsData(options)](#removePasswordsData)\n- [removeServiceWorkersData(options)](#removeServiceWorkersData)\n- [removeWebSQLData(options)](#removeWebSQLData)\n- [getBrowsingDataSettings()](#getBrowsingDataSettings)\n\n\u003ca name=\"removeBrowsingData\"\u003e\u003c/a\u003e\n\n### removeBrowsingData\n\n```\nremoveBrowsingData(options: chrome.browsingData.RemovalOptions, dataToRemove: chrome.browsingData.DataTypeSet): Promise\u003cvoid\u003e\n```\n\nClears the specified types of browsing data within the given time range.\n\n\u003ca name=\"removeAppcacheData\"\u003e\u003c/a\u003e\n\n### removeAppcacheData\n\n```\nremoveAppcacheData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears the application cache.\n\n\u003ca name=\"removeCacheData\"\u003e\u003c/a\u003e\n\n### removeCacheData\n\n```\nremoveCacheData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears the browser cache.\n\n\u003ca name=\"removeCacheStorageData\"\u003e\u003c/a\u003e\n\n### removeCacheStorageData\n\n```\nremoveCacheStorageData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears Cache Storage.\n\n\u003ca name=\"removeCookiesData\"\u003e\u003c/a\u003e\n\n### removeCookiesData\n\n```\nremoveCookiesData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears all cookies.\n\n\u003ca name=\"removeDownloadsData\"\u003e\u003c/a\u003e\n\n### removeDownloadsData\n\n```\nremoveDownloadsData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears download history.\n\n\u003ca name=\"removeFileSystemsData\"\u003e\u003c/a\u003e\n\n### removeFileSystemsData\n\n```\nremoveFileSystemsData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears file system data.\n\n\u003ca name=\"removeFormData\"\u003e\u003c/a\u003e\n\n### removeFormData\n\n```\nremoveFormData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears data entered into forms.\n\n\u003ca name=\"removeHistoryData\"\u003e\u003c/a\u003e\n\n### removeHistoryData\n\n```\nremoveHistoryData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears browsing history.\n\n\u003ca name=\"removeIndexedDBData\"\u003e\u003c/a\u003e\n\n### removeIndexedDBData\n\n```\nremoveIndexedDBData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears IndexedDB data.\n\n\u003ca name=\"removeLocalStorageData\"\u003e\u003c/a\u003e\n\n### removeLocalStorageData\n\n```\nremoveLocalStorageData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears Local Storage data.\n\n\u003ca name=\"removePasswordsData\"\u003e\u003c/a\u003e\n\n### removePasswordsData\n\n```\nremovePasswordsData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears saved passwords.\n\n\u003ca name=\"removeServiceWorkersData\"\u003e\u003c/a\u003e\n\n### removeServiceWorkersData\n\n```\nremoveServiceWorkersData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears Service Worker registrations.\n\n\u003ca name=\"removeWebSQLData\"\u003e\u003c/a\u003e\n\n### removeWebSQLData\n\n```\nremoveWebSQLData(options?: chrome.browsingData.RemovalOptions): Promise\u003cvoid\u003e\n```\n\nClears WebSQL data.\n\n\u003ca name=\"getBrowsingDataSettings\"\u003e\u003c/a\u003e\n\n### getBrowsingDataSettings\n\n```\ngetBrowsingDataSettings(): Promise\u003cchrome.browsingData.SettingsResult\u003e\n```\n\nRetrieves the current browsing data removal settings.\n\n\u003ca name=\"commands\"\u003e\u003c/a\u003e\n\n## commands\n\n**Documentation:** [Chrome Commands API](https://developer.chrome.com/docs/extensions/reference/commands)\n\nA promise-based wrapper for the Chrome `commands` API.\n\n### Methods\n\n- [getAllCommands()](#getAllCommands)\n\n### Events\n\n- [onCommand(callback)](#onCommand)\n\n\u003ca name=\"getAllCommands\"\u003e\u003c/a\u003e\n\n### getAllCommands\n\n```\ngetAllCommands(): Promise\u003cchrome.commands.Command[]\u003e\n```\n\nRetrieves all registered extension commands.\n\n\u003ca name=\"onCommand\"\u003e\u003c/a\u003e\n\n### onCommand\n\n```\nonCommand(callback: (command: string, tab: chrome.tabs.Tab) =\u003e void): () =\u003e void\n```\n\nAdds a listener for extension command events.\n\n\u003ca name=\"contextMenus\"\u003e\u003c/a\u003e\n\n## contextMenus\n\n**Documentation:** [Chrome Context Menus API](https://developer.chrome.com/docs/extensions/reference/contextMenus)\n\nA promise-based wrapper for the Chrome `contextMenus` API.\n\n### Methods\n\n- [createContextMenus(createProperties)](#createContextMenus)\n- [removeContextMenus(menuItemId)](#removeContextMenus)\n- [removeAllContextMenus()](#removeAllContextMenus)\n- [updateContextMenus(id, updateProperties)](#updateContextMenus)\n\n### Events\n\n- [onContextMenusClicked(callback)](#onContextMenusClicked)\n\n\u003ca name=\"createContextMenus\"\u003e\u003c/a\u003e\n\n### createContextMenus\n\n```\ncreateContextMenus(createProperties?: chrome.contextMenus.CreateProperties): Promise\u003cvoid\u003e\n```\n\nCreates a new context menu item with the specified properties.\n\n\u003ca name=\"removeContextMenus\"\u003e\u003c/a\u003e\n\n### removeContextMenus\n\n```\nremoveContextMenus(menuItemId: string | number): Promise\u003cvoid\u003e\n```\n\nRemoves the context menu item with the given ID.\n\n\u003ca name=\"removeAllContextMenus\"\u003e\u003c/a\u003e\n\n### removeAllContextMenus\n\n```\nremoveAllContextMenus(): Promise\u003cvoid\u003e\n```\n\nRemoves all context menu items added by the extension.\n\n\u003ca name=\"updateContextMenus\"\u003e\u003c/a\u003e\n\n### updateContextMenus\n\n```\nupdateContextMenus(id: string | number, updateProperties?: Omit\u003cchrome.contextMenus.CreateProperties, 'id'\u003e): Promise\u003cvoid\u003e\n```\n\nUpdates the specified context menu item with new properties.\n\n\u003ca name=\"onContextMenusClicked\"\u003e\u003c/a\u003e\n\n### onContextMenusClicked\n\n```\nonContextMenusClicked(callback: (info: chrome.contextMenus.OnClickData, tab: chrome.tabs.Tab) =\u003e void): () =\u003e void\n```\n\nAdds a listener that triggers when a context menu item is clicked.\n\n\u003ca name=\"cookies\"\u003e\u003c/a\u003e\n\n## cookies\n\n**Documentation:** [Chrome Cookies API](https://developer.chrome.com/docs/extensions/reference/cookies)\n\nA promise-based wrapper for the Chrome `cookies` API.\n\n### Methods\n\n- [getCookie(details)](#getCookie)\n- [getAllCookie(details)](#getAllCookie)\n- [getAllCookieStores()](#getAllCookieStores)\n- [getCookiePartitionKey(details)](#getCookiePartitionKey)\n- [removeCookie(details)](#removeCookie)\n- [setCookie(details)](#setCookie)\n\n### Events\n\n- [onCookieChanged(callback)](#onCookieChanged)\n\n\u003ca name=\"getCookie\"\u003e\u003c/a\u003e\n\n### getCookie\n\n```\ngetCookie(details: chrome.cookies.CookieDetails): Promise\u003cchrome.cookies.Cookie | null\u003e\n```\n\nRetrieves the cookie matching the specified details, or `null` if not found.\n\n\u003ca name=\"getAllCookie\"\u003e\u003c/a\u003e\n\n### getAllCookie\n\n```\ngetAllCookie(details?: chrome.cookies.GetAllDetails): Promise\u003cchrome.cookies.Cookie[]\u003e\n```\n\nRetrieves all cookies that match the given filter details.\n\n\u003ca name=\"getAllCookieStores\"\u003e\u003c/a\u003e\n\n### getAllCookieStores\n\n```\ngetAllCookieStores(): Promise\u003cchrome.cookies.CookieStore[]\u003e\n```\n\nRetrieves all cookie stores accessible to the extension.\n\n\u003ca name=\"getCookiePartitionKey\"\u003e\u003c/a\u003e\n\n### getCookiePartitionKey [MV3]\n\n```\ngetCookiePartitionKey(details: chrome.cookies.FrameDetails): Promise\u003cchrome.cookies.CookiePartitionKey\u003e\n```\n\nRetrieves the partition key for the cookie associated with the given frame (Manifest V3 only).\n\n\u003ca name=\"removeCookie\"\u003e\u003c/a\u003e\n\n### removeCookie\n\n```\nremoveCookie(details: chrome.cookies.CookieDetails): Promise\u003cchrome.cookies.CookieDetails\u003e\n```\n\nRemoves the cookie matching the specified details, returning the details of the removed cookie.\n\n\u003ca name=\"setCookie\"\u003e\u003c/a\u003e\n\n### setCookie\n\n```\nsetCookie(details: chrome.cookies.SetDetails): Promise\u003cchrome.cookies.Cookie | null\u003e\n```\n\nSets a cookie with the given details, returning the created cookie or `null` on failure.\n\n\u003ca name=\"onCookieChanged\"\u003e\u003c/a\u003e\n\n### onCookieChanged\n\n```\nonCookieChanged(callback: (changeInfo: chrome.cookies.CookieChangeInfo) =\u003e void): () =\u003e void\n```\n\nAdds a listener that triggers when a cookie change event occurs.\n\n\u003ca name=\"documentscan\"\u003e\u003c/a\u003e\n\n## documentscan\n\n**Documentation:** [Chrome Document Scan API](https://developer.chrome.com/docs/extensions/reference/documentScan)\n\nA promise-based wrapper for the Chrome `documentScan` API.\n\n### Methods\n\n- [cancelDocScanning](#cancelDocScanning)\n- [closeDocScanner](#closeDocScanner)\n- [getDocScannerOptionGroups](#getDocScannerOptionGroups)\n- [getDocScannerList](#getDocScannerList)\n- [openDocScanner](#openDocScanner)\n- [readDocScanningData](#readDocScanningData)\n- [docScanning](#docScanning)\n- [setDocScannerOptions](#setDocScannerOptions)\n- [startDocScanning](#startDocScanning)\n\n\u003ca name=\"cancelDocScanning\"\u003e\u003c/a\u003e\n\n### cancelDocScanning\n\n```\ncancelDocScanning(job: string): Promise\u003cchrome.documentScan.CancelScanResponse\u003cstring\u003e\u003e\n```\n\nCancels an ongoing document scan job.\n\n\u003ca name=\"closeDocScanner\"\u003e\u003c/a\u003e\n\n### closeDocScanner\n\n```\ncloseDocScanner(scannerHandle: string): Promise\u003cchrome.documentScan.CloseScannerResponse\u003cstring\u003e\u003e\n```\n\nCloses the document scanner associated with the specified scanner handle.\n\n\u003ca name=\"getDocScannerOptionGroups\"\u003e\u003c/a\u003e\n\n### getDocScannerOptionGroups\n\n```\ngetDocScannerOptionGroups(scannerHandle: string): Promise\u003cchrome.documentScan.GetOptionGroupsResponse\u003cstring\u003e\u003e\n```\n\nRetrieves the available option groups for the specified document scanner.\n\n\u003ca name=\"getDocScannerList\"\u003e\u003c/a\u003e\n\n### getDocScannerList\n\n```\ngetDocScannerList(filter: chrome.documentScan.DeviceFilter): Promise\u003cchrome.documentScan.GetScannerListResponse\u003e\n```\n\nFetches a list of document scanners matching the given filter criteria.\n\n\u003ca name=\"openDocScanner\"\u003e\u003c/a\u003e\n\n### openDocScanner\n\n```\nopenDocScanner(scannerId: string): Promise\u003cchrome.documentScan.OpenScannerResponse\u003cstring\u003e\u003e\n```\n\nOpens a document scanner by its ID, returning a handle for further operations.\n\n\u003ca name=\"readDocScanningData\"\u003e\u003c/a\u003e\n\n### readDocScanningData\n\n```\nreadDocScanningData(job: string): Promise\u003cchrome.documentScan.ReadScanDataResponse\u003cstring\u003e\u003e\n```\n\nReads a chunk of data from an ongoing scan job.\n\n\u003ca name=\"docScanning\"\u003e\u003c/a\u003e\n\n### docScanning\n\n```\ndocScanning(options: chrome.documentScan.ScanOptions): Promise\u003cchrome.documentScan.ScanResults\u003e\n```\n\nPerforms a document scan with the specified options and returns the scan results.\n\n\u003ca name=\"setDocScannerOptions\"\u003e\u003c/a\u003e\n\n### setDocScannerOptions\n\n```\nsetDocScannerOptions(scannerHandle: string, options: chrome.documentScan.OptionSetting[]): Promise\u003cchrome.documentScan.SetOptionsResponse\u003cstring\u003e\u003e\n```\n\nSets the scanner options for the given scanner handle.\n\n\u003ca name=\"startDocScanning\"\u003e\u003c/a\u003e\n\n### startDocScanning\n\n```\nstartDocScanning(scannerHandle: string, options: chrome.documentScan.StartScanOptions): Promise\u003cchrome.documentScan.StartScanResponse\u003cstring\u003e\u003e\n```\n\nStarts a scan operation on an open scanner with the provided settings.\n\n\u003ca name=\"downloads\"\u003e\u003c/a\u003e\n\n## downloads\n\n**Documentation:** [Chrome Downloads API](https://developer.chrome.com/docs/extensions/reference/downloads)\n\nA promise-based wrapper for the Chrome `downloads` API.\n\n### Methods\n\n- [acceptDownloadDanger](#acceptDownloadDanger)\n- [cancelDownload](#cancelDownload)\n- [download](#download)\n- [eraseDownload](#eraseDownload)\n- [getDownloadFileIcon](#getDownloadFileIcon)\n- [openDownload](#openDownload)\n- [pauseDownload](#pauseDownload)\n- [removeDownloadFile](#removeDownloadFile)\n- [resumeDownload](#resumeDownload)\n- [searchDownloads](#searchDownloads)\n- [setDownloadsUiOptions](#setDownloadsUiOptions)\n- [showDownloadFolder](#showDownloadFolder)\n- [showDownload](#showDownload)\n- [findDownload](#findDownload)\n- [isDownloadExists](#isDownloadExists)\n- [getDownloadState](#getDownloadState)\n\n### Events\n\n- [onDownloadsChanged](#onDownloadsChanged)\n- [onDownloadsCreated](#onDownloadsCreated)\n- [onDownloadsDeterminingFilename](#onDownloadsDeterminingFilename)\n\n\u003ca name=\"acceptDownloadDanger\"\u003e\u003c/a\u003e\n\n### acceptDownloadDanger\n\n```\nacceptDownloadDanger(downloadId: number): Promise\u003cvoid\u003e\n```\n\nAccepts a dangerous download, allowing it to proceed.\n\n\u003ca name=\"cancelDownload\"\u003e\u003c/a\u003e\n\n### cancelDownload\n\n```\ncancelDownload(downloadId: number): Promise\u003cvoid\u003e\n```\n\nCancels the specified download.\n\n\u003ca name=\"download\"\u003e\u003c/a\u003e\n\n### download\n\n```\ndownload(options: chrome.downloads.DownloadOptions): Promise\u003cnumber\u003e\n```\n\nInitiates a download with the given options, resolving to the download ID. This function automatically uniquifies filenames on conflict and verifies the download's completion, throwing a `BlockDownloadError` if the download is interrupted or requires additional permissions.\n\n\u003ca name=\"eraseDownload\"\u003e\u003c/a\u003e\n\n### eraseDownload\n\n```\neraseDownload(query: chrome.downloads.DownloadQuery): Promise\u003cnumber[]\u003e\n```\n\nRemoves the download history entries that match the given query, returning the list of erased download IDs.\n\n\u003ca name=\"getDownloadFileIcon\"\u003e\u003c/a\u003e\n\n### getDownloadFileIcon\n\n```\ngetDownloadFileIcon(downloadId: number, options: chrome.downloads.GetFileIconOptions): Promise\u003cstring\u003e\n```\n\nRetrieves the icon for the downloaded file.\n\n\u003ca name=\"openDownload\"\u003e\u003c/a\u003e\n\n### openDownload\n\n```\nopenDownload(downloadId: number): void\n```\n\nOpens the downloaded file.\n\n\u003ca name=\"pauseDownload\"\u003e\u003c/a\u003e\n\n### pauseDownload\n\n```\npauseDownload(downloadId: number): Promise\u003cvoid\u003e\n```\n\nPauses an active download.\n\n\u003ca name=\"removeDownloadFile\"\u003e\u003c/a\u003e\n\n### removeDownloadFile\n\n```\nremoveDownloadFile(downloadId: number): Promise\u003cvoid\u003e\n```\n\nDeletes the downloaded file from the local disk.\n\n\u003ca name=\"resumeDownload\"\u003e\u003c/a\u003e\n\n### resumeDownload\n\n```\nresumeDownload(downloadId: number): Promise\u003cvoid\u003e\n```\n\nResumes a paused download.\n\n\u003ca name=\"searchDownloads\"\u003e\u003c/a\u003e\n\n### searchDownloads\n\n```\nsearchDownloads(query: chrome.downloads.DownloadQuery): Promise\u003cchrome.downloads.DownloadItem[]\u003e\n```\n\nSearches for downloads matching the specified query.\n\n\u003ca name=\"setDownloadsUiOptions\"\u003e\u003c/a\u003e\n\n### setDownloadsUiOptions\n\n```\nsetDownloadsUiOptions(enabled: boolean): Promise\u003cvoid\u003e\n```\n\nEnables or disables the browser's default download UI.\n\n\u003ca name=\"showDownloadFolder\"\u003e\u003c/a\u003e\n\n### showDownloadFolder\n\n```\nshowDownloadFolder(): void\n```\n\nShows the default download folder in the file explorer.\n\n\u003ca name=\"showDownload\"\u003e\u003c/a\u003e\n\n### showDownload\n\n```\nshowDownload(downloadId: number): Promise\u003cboolean\u003e\n```\n\nAttempts to reveal the specified download in the file explorer, returning `true` if it exists.\n\n\u003ca name=\"findDownload\"\u003e\u003c/a\u003e\n\n### findDownload\n\n```\nfindDownload(downloadId: number): Promise\u003cchrome.downloads.DownloadItem | undefined\u003e\n```\n\nRetrieves the download item for the given download ID, if it exists.\n\n\u003ca name=\"isDownloadExists\"\u003e\u003c/a\u003e\n\n### isDownloadExists\n\n```\nisDownloadExists(downloadId: number): Promise\u003cboolean | undefined\u003e\n```\n\nChecks whether a download with the specified ID exists.\n\n\u003ca name=\"getDownloadState\"\u003e\u003c/a\u003e\n\n### getDownloadState\n\n```\ngetDownloadState(downloadId?: number): Promise\u003cchrome.downloads.DownloadState | undefined\u003e\n```\n\nRetrieves the state (`in_progress`, `complete`, or `interrupted`) of the given download.\n\n\u003ca name=\"onDownloadsChanged\"\u003e\u003c/a\u003e\n\n### onDownloadsChanged\n\n```\nonDownloadsChanged(callback: Parameters\u003ctypeof chrome.downloads.onChanged.addListener\u003e[0]): () =\u003e void\n```\n\nAdds a listener triggered when a download's state or properties change.\n\n\u003ca name=\"onDownloadsCreated\"\u003e\u003c/a\u003e\n\n### onDownloadsCreated\n\n```\nonDownloadsCreated(callback: Parameters\u003ctypeof chrome.downloads.onCreated.addListener\u003e[0]): () =\u003e void\n```\n\nAdds a listener triggered when a new download is created.\n\n\u003ca name=\"onDownloadsDeterminingFilename\"\u003e\u003c/a\u003e\n\n### onDownloadsDeterminingFilename\n\n```\nonDownloadsDeterminingFilename(callback: Parameters\u003ctypeof chrome.downloads.onDeterminingFilename.addListener\u003e[0]): () =\u003e void\n```\n\nAdds a listener triggered when a download's filename is being determined.\n\n\u003ca name=\"extension\"\u003e\u003c/a\u003e\n\n## extension\n\n**Documentation:** [Chrome Extension API](https://developer.chrome.com/docs/extensions/reference/extension)\n\nA promise-based wrapper for the Chrome `extension` API.\n\n### Methods\n\n- [getBackgroundPage](#getBackgroundPage)\n- [getViews](#getViews)\n- [isAllowedFileSchemeAccess](#isAllowedFileSchemeAccess)\n- [isAllowedIncognitoAccess](#isAllowedIncognitoAccess)\n- [setUpdateUrlData](#setUpdateUrlData)\n\n\u003ca name=\"getBackgroundPage\"\u003e\u003c/a\u003e\n\n### getBackgroundPage\n\n```\ngetBackgroundPage(): Window | null\n```\n\nReturns the `window` object of the extension's background page, or `null` if no background page exists.\n\n\u003ca name=\"getViews\"\u003e\u003c/a\u003e\n\n### getViews\n\n```\ngetViews(properties?: chrome.extension.FetchProperties): Window[]\n```\n\nRetrieves all active extension views (e.g., background, popup, options), optionally filtered by the specified properties.\n\n\u003ca name=\"isAllowedFileSchemeAccess\"\u003e\u003c/a\u003e\n\n### isAllowedFileSchemeAccess\n\n```\nisAllowedFileSchemeAccess(): Promise\u003cboolean\u003e\n```\n\nChecks if the extension has permission to access file system URLs (`file://`).\n\n\u003ca name=\"isAllowedIncognitoAccess\"\u003e\u003c/a\u003e\n\n### isAllowedIncognitoAccess\n\n```\nisAllowedIncognitoAccess(): Promise\u003cboolean\u003e\n```\n\nDetermines whether the extension is allowed to operate in incognito mode.\n\n\u003ca name=\"setUpdateUrlData\"\u003e\u003c/a\u003e\n\n### setUpdateUrlData\n\n```\nsetUpdateUrlData(data: string): void\n```\n\nSets the data string to be sent as part of the extension's update check URL.\n\n\u003ca name=\"fileBrowserHandler\"\u003e\u003c/a\u003e\n\n## fileBrowserHandler\n\n**Documentation:** [Chrome File Browser Handler API](https://developer.chrome.com/docs/extensions/reference/fileBrowserHandler)\n\nA wrapper for the Chrome `fileBrowserHandler` API to manage file browser actions.\n\n### Events\n\n- [onExecute](#onExecute)\n\n\u003ca name=\"onExecute\"\u003e\u003c/a\u003e\n\n### onExecute\n\n```\nonExecute(callback: (id: string, details: chrome.fileBrowserHandler.FileBrowserHandlerExecuteDetails) =\u003e void): () =\u003e void\n```\n\nAdds a listener triggered when the user invokes the extension via the file browser. Returns a function to remove the listener.\n\n\u003ca name=\"history\"\u003e\u003c/a\u003e\n\n## history\n\n**Documentation:** [Chrome History API](https://developer.chrome.com/docs/extensions/reference/history)\n\nA promise-based wrapper for the Chrome `history` API to manage browser history.\n\n### Methods\n\n- [addHistoryUrl](#addHistoryUrl)\n- [deleteAllHistory](#deleteAllHistory)\n- [deleteRangeHistory](#deleteRangeHistory)\n- [deleteHistoryUrl](#deleteHistoryUrl)\n- [getHistoryVisits](#getHistoryVisits)\n- [searchHistory](#searchHistory)\n\n### Events\n\n- [onHistoryVisited](#onHistoryVisited)\n- [onHistoryVisitRemoved](#onHistoryVisitRemoved)\n\n\u003ca name=\"addHistoryUrl\"\u003e\u003c/a\u003e\n\n### addHistoryUrl\n\n```\naddHistoryUrl(url: string): Promise\u003cvoid\u003e\n```\n\nAdds the specified URL to the browser history.\n\n\u003ca name=\"deleteAllHistory\"\u003e\u003c/a\u003e\n\n### deleteAllHistory\n\n```\ndeleteAllHistory(): Promise\u003cvoid\u003e\n```\n\nDeletes all entries from the browser history.\n\n\u003ca name=\"deleteRangeHistory\"\u003e\u003c/a\u003e\n\n### deleteRangeHistory\n\n```\ndeleteRangeHistory(range: chrome.history.Range): Promise\u003cvoid\u003e\n```\n\nRemoves all history entries within the specified time range.\n\n\u003ca name=\"deleteHistoryUrl\"\u003e\u003c/a\u003e\n\n### deleteHistoryUrl\n\n```\ndeleteHistoryUrl(details: chrome.history.Url): Promise\u003cvoid\u003e\n```\n\nDeletes all occurrences of the given URL from the history.\n\n\u003ca name=\"getHistoryVisits\"\u003e\u003c/a\u003e\n\n### getHistoryVisits\n\n```\ngetHistoryVisits(url: string): Promise\u003cchrome.history.VisitItem[]\u003e\n```\n\nRetrieves the visit history for the specified URL.\n\n\u003ca name=\"searchHistory\"\u003e\u003c/a\u003e\n\n### searchHistory\n\n```\nsearchHistory(query: chrome.history.HistoryQuery): Promise\u003cchrome.history.HistoryItem[]\u003e\n```\n\nSearches the browser history with the given query, returning matching history items.\n\n\u003ca name=\"onHistoryVisited\"\u003e\u003c/a\u003e\n\n### onHistoryVisited\n\n```\nonHistoryVisited(callback: (result: chrome.history.HistoryItem) =\u003e void): () =\u003e void\n```\n\nAdds a listener triggered when the browser records a page visit.\n\n\u003ca name=\"onHistoryVisitRemoved\"\u003e\u003c/a\u003e\n\n### onHistoryVisitRemoved\n\n```\nonHistoryVisitRemoved(callback: (removed: chrome.history.RemoveInfo) =\u003e void): () =\u003e void\n```\n\nAdds a listener triggered when URLs are removed from the history, providing details of the removal.\u003ca name=\"i18n\"\u003e\u003c/a\u003e\n\n## i18n\n\n**Documentation:** [Chrome i18n API](https://developer.chrome.com/docs/extensions/reference/i18n)\n\nA promise-based wrapper for the Chrome `i18n` API to manage localization.\n\n### Methods\n\n- [detectI18Language](#detectI18Language)\n- [getI18nAcceptLanguages](#getI18nAcceptLanguages)\n- [getI18nUILanguage](#getI18nUILanguage)\n- [getI18nMessage](#getI18nMessage)\n- [getDefaultLanguage](#getDefaultLanguage)\n\n\u003ca name=\"detectI18Language\"\u003e\u003c/a\u003e\n\n### detectI18Language\n\n```\ndetectI18Language(text: string): Promise\u003cchrome.i18n.LanguageDetectionResult\u003e\n```\n\nDetects the primary language of the provided text.\n\n\u003ca name=\"getI18nAcceptLanguages\"\u003e\u003c/a\u003e\n\n### getI18nAcceptLanguages\n\n```\ngetI18nAcceptLanguages(): Promise\u003cstring[]\u003e\n```\n\nRetrieves the user's preferred accept languages list.\n\n\u003ca name=\"getI18nUILanguage\"\u003e\u003c/a\u003e\n\n### getI18nUILanguage\n\n```\ngetI18nUILanguage(): string | undefined\n```\n\nReturns the browser's UI language code.\n\n\u003ca name=\"getI18nMessage\"\u003e\u003c/a\u003e\n\n### getI18nMessage\n\n```\ngetI18nMessage(key: string): string | undefined\n```\n\nRetrieves the localized message for the specified key.\n\n\u003ca name=\"getDefaultLanguage\"\u003e\u003c/a\u003e\n\n### getDefaultLanguage\n\n```\ngetDefaultLanguage(): string | undefined\n```\n\nExtracts the default locale as declared in the extension manifest.\n\n\u003ca name=\"idle\"\u003e\u003c/a\u003e\n\n## idle\n\n**Documentation:** [Chrome Idle API](https://developer.chrome.com/docs/extensions/reference/idle)\n\nA promise-based wrapper for the Chrome `idle` API to monitor user idle state.\n\n### Methods\n\n- [getIdleAutoLockDelay](#getIdleAutoLockDelay)\n- [queryIdleState](#queryIdleState)\n- [setIdleDetectionInterval](#setIdleDetectionInterval)\n\n### Events\n\n- [onIdleStateChanged](#onIdleStateChanged)\n\n\u003ca name=\"getIdleAutoLockDelay\"\u003e\u003c/a\u003e\n\n### getIdleAutoLockDelay\n\n```\ngetIdleAutoLockDelay(): Promise\u003cnumber\u003e\n```\n\nRetrieves the number of seconds before the system auto-locks due to inactivity.\n\n\u003ca name=\"queryIdleState\"\u003e\u003c/a\u003e\n\n### queryIdleState\n\n```\nqueryIdleState(detectionIntervalInSeconds: number): Promise\u003cchrome.idle.IdleState\u003e\n```\n\nQueries the user's idle state within the specified detection interval.\n\n\u003ca name=\"setIdleDetectionInterval\"\u003e\u003c/a\u003e\n\n### setIdleDetectionInterval\n\n```\nsetIdleDetectionInterval(intervalInSeconds: number): void\n```\n\nSets the interval, in seconds, used to detect idle state changes.\n\n\u003ca name=\"onIdleStateChanged\"\u003e\u003c/a\u003e\n\n### onIdleStateChanged\n\n```\nonIdleStateChanged(callback: (newState: chrome.idle.IdleState) =\u003e void): () =\u003e void\n```\n\nAdds a listener that fires when the user's idle state changes, returning a function to remove the listener.\n\n\u003ca name=\"management\"\u003e\u003c/a\u003e\n\n## management\n\n**Documentation:** [Chrome Management API](https://developer.chrome.com/docs/extensions/reference/management)\n\nA promise-based wrapper for the Chrome `management` API to manage extensions and apps.\n\n### Methods\n\n- [createAppShortcut](#createAppShortcut)\n- [generateAppForLink](#generateAppForLink)\n- [getExtensionInfo](#getExtensionInfo)\n- [getAllExtensionInfo](#getAllExtensionInfo)\n- [getPermissionWarningsById](#getPermissionWarningsById)\n- [getPermissionWarningsByManifest](#getPermissionWarningsByManifest)\n- [getCurrentExtension](#getCurrentExtension)\n- [launchExtensionApp](#launchExtensionApp)\n- [setExtensionEnabled](#setExtensionEnabled)\n- [setExtensionLaunchType](#setExtensionLaunchType)\n- [uninstallExtension](#uninstallExtension)\n- [uninstallCurrentExtension](#uninstallCurrentExtension)\n\n### Events\n\n- [onExtensionDisabled](#onExtensionDisabled)\n- [onExtensionEnabled](#onExtensionEnabled)\n- [onExtensionInstalled](#onExtensionInstalled)\n- [onExtensionUninstalled](#onExtensionUninstalled)\n\n\u003ca name=\"createAppShortcut\"\u003e\u003c/a\u003e\n\n### createAppShortcut\n\n```\ncreateAppShortcut(id: string): Promise\u003cvoid\u003e\n```\n\nCreates a desktop shortcut for the specified app ID.\n\n\u003ca name=\"generateAppForLink\"\u003e\u003c/a\u003e\n\n### generateAppForLink\n\n```\ngenerateAppForLink(url: string, title: string): Promise\u003cchrome.management.ExtensionInfo\u003e\n```\n\nGenerates a Chrome app for the given URL and title, returning its extension info.\n\n\u003ca name=\"getExtensionInfo\"\u003e\u003c/a\u003e\n\n### getExtensionInfo\n\n```\ngetExtensionInfo(id: string): Promise\u003cchrome.management.ExtensionInfo\u003e\n```\n\nRetrieves information about the extension or app with the specified ID.\n\n\u003ca name=\"getAllExtensionInfo\"\u003e\u003c/a\u003e\n\n### getAllExtensionInfo\n\n```\ngetAllExtensionInfo(): Promise\u003cchrome.management.ExtensionInfo[]\u003e\n```\n\nRetrieves information about all installed extensions and apps.\n\n\u003ca name=\"getPermissionWarningsById\"\u003e\u003c/a\u003e\n\n### getPermissionWarningsById\n\n```\ngetPermissionWarningsById(id: string): Promise\u003cstring[]\u003e\n```\n\nGets permission warning messages for the specified extension ID.\n\n\u003ca name=\"getPermissionWarningsByManifest\"\u003e\u003c/a\u003e\n\n### getPermissionWarningsByManifest\n\n```\ngetPermissionWarningsByManifest(manifestStr: string): Promise\u003cstring[]\u003e\n```\n\nGets permission warning messages for the given manifest string.\n\n\u003ca name=\"getCurrentExtension\"\u003e\u003c/a\u003e\n\n### getCurrentExtension\n\n```\ngetCurrentExtension(): Promise\u003cchrome.management.ExtensionInfo\u003e\n```\n\nRetrieves information about the current extension.\n\n\u003ca name=\"launchExtensionApp\"\u003e\u003c/a\u003e\n\n### launchExtensionApp\n\n```\nlaunchExtensionApp(id: string): Promise\u003cvoid\u003e\n```\n\nLaunches the specified extension app by ID.\n\n\u003ca name=\"setExtensionEnabled\"\u003e\u003c/a\u003e\n\n### setExtensionEnabled\n\n```\nsetExtensionEnabled(id: string, enabled: boolean): Promise\u003cvoid\u003e\n```\n\nEnables or disables the specified extension or app.\n\n\u003ca name=\"setExtensionLaunchType\"\u003e\u003c/a\u003e\n\n### setExtensionLaunchType\n\n```\nsetExtensionLaunchType(id: string, launchType: string): Promise\u003cvoid\u003e\n```\n\nSets the launch type (e.g., regular, pinned) for the specified extension.\n\n\u003ca name=\"uninstallExtension\"\u003e\u003c/a\u003e\n\n### uninstallExtension\n\n```\nuninstallExtension(id: string, showConfirmDialog?: boolean): Promise\u003cvoid\u003e\n```\n\nUninstalls the extension with the given ID, optionally showing a confirmation dialog.\n\n\u003ca name=\"uninstallCurrentExtension\"\u003e\u003c/a\u003e\n\n### uninstallCurrentExtension\n\n```\nuninstallCurrentExtension(showConfirmDialog?: boolean): Promise\u003cvoid\u003e\n```\n\nUninstalls the current extension, optionally showing a confirmation dialog.\n\n\u003ca name=\"onExtensionDisabled\"\u003e\u003c/a\u003e\n\n### onExtensionDisabled\n\n```\nonExtensionDisabled(callback: (info: chrome.management.ExtensionInfo) =\u003e void): () =\u003e void\n```\n\nFires when an extension or app is disabled.\n\n\u003ca name=\"onExtensionEnabled\"\u003e\u003c/a\u003e\n\n### onExtensionEnabled\n\n```\nonExtensionEnabled(callback: (info: chrome.management.ExtensionInfo) =\u003e void): () =\u003e void\n```\n\nFires when an extension or app is enabled.\n\n\u003ca name=\"onExtensionInstalled\"\u003e\u003c/a\u003e\n\n### onExtensionInstalled\n\n```\nonExtensionInstalled(callback: (info: chrome.management.ExtensionInfo) =\u003e void): () =\u003e void\n```\n\nFires when an extension or app is installed.\n\n\u003ca name=\"onExtensionUninstalled\"\u003e\u003c/a\u003e\n\n### onExtensionUninstalled\n\n```\nonExtensionUninstalled(callback: (extensionId: string) =\u003e void): () =\u003e void\n```\n\nFires when an extension or app is uninstalled, passing its ID.\n\n\u003ca name=\"notifications\"\u003e\u003c/a\u003e\n\n## notifications\n\n**Documentation:** [Chrome Notifications API](https://developer.chrome.com/docs/extensions/reference/notifications)\n\nA promise-based wrapper for the Chrome `notifications` API to create and manage desktop notifications.\n\n### Methods\n\n- [clearNotification](#clearNotification)\n- [createNotification](#createNotification)\n- [getAllNotification](#getAllNotification)\n- [getNotificationPermissionLevel](#getNotificationPermissionLevel)\n- [updateNotification](#updateNotification)\n- [isSupportNotifications](#isSupportNotifications)\n- [clearAllNotification](#clearAllNotification)\n\n### Events\n\n- [onNotificationsButtonClicked](#onNotificationsButtonClicked)\n- [onNotificationsClicked](#onNotificationsClicked)\n- [onNotificationsClosed](#onNotificationsClosed)\n- [onNotificationsPermissionLevelChanged](#onNotificationsPermissionLevelChanged)\n\n\u003ca name=\"clearNotification\"\u003e\u003c/a\u003e\n\n### clearNotification\n\n```\nclearNotification(notificationId: string): Promise\u003cboolean\u003e\n```\n\nClears the notification with the specified ID, resolving to `true` if the notification existed and was cleared.\n\n\u003ca name=\"createNotification\"\u003e\u003c/a\u003e\n\n### createNotification\n\n```\ncreateNotification(options: chrome.notifications.NotificationOptions, notificationId?: string): Promise\u003cstring\u003e\n```\n\nCreates a notification with the given options and optional ID, returning the notification ID.\n\n\u003ca name=\"getAllNotification\"\u003e\u003c/a\u003e\n\n### getAllNotification\n\n```\ngetAllNotification(): Promise\u003c{ [notificationId: string]: chrome.notifications.NotificationOptions }\u003e\n```\n\nRetrieves all notifications currently displayed, returned as a map of notification IDs to their options.\n\n\u003ca name=\"getNotificationPermissionLevel\"\u003e\u003c/a\u003e\n\n### getNotificationPermissionLevel\n\n```\ngetNotificationPermissionLevel(): Promise\u003cstring\u003e\n```\n\nGets the current permission level for notifications.\n\n\u003ca name=\"updateNotification\"\u003e\u003c/a\u003e\n\n### updateNotification\n\n```\nupdateNotification(options: chrome.notifications.NotificationOptions, notificationId: string): Promise\u003cboolean\u003e\n```\n\nUpdates an existing notification with new options, resolving to `true` if the notification was updated.\n\n\u003ca name=\"isSupportNotifications\"\u003e\u003c/a\u003e\n\n### isSupportNotifications\n\n```\nisSupportNotifications(): boolean\n```\n\nChecks if the Notifications API is supported in the current browser.\n\n\u003ca name=\"clearAllNotification\"\u003e\u003c/a\u003e\n\n### clearAllNotification\n\n```\nclearAllNotification(): Promise\u003cvoid\u003e\n```\n\nClears all currently displayed notifications.\n\n\u003ca name=\"onNotificationsButtonClicked\"\u003e\u003c/a\u003e\n\n### onNotificationsButtonClicked\n\n```\nonNotificationsButtonClicked(callback: (notificationId: string, buttonIndex: number) =\u003e void): () =\u003e void\n```\n\nAdds a listener for when a button on a notification is clicked, returning a function to remove the listener.\n\n\u003ca name=\"onNotificationsClicked\"\u003e\u003c/a\u003e\n\n### onNotificationsClicked\n\n```\nonNotificationsClicked(callback: (notificationId: string) =\u003e void): () =\u003e void\n```\n\nAdds a listener for when a notification itself is clicked.\n\n\u003ca name=\"onNotificationsClosed\"\u003e\u003c/a\u003e\n\n### onNotificationsClosed\n\n```\nonNotificationsClosed(callback: (notificationId: string, byUser: boolean) =\u003e void): () =\u003e void\n```\n\nAdds a listener for when a notification is closed, including whether it was closed by the user.\n\n\u003ca name=\"onNotificationsPermissionLevelChanged\"\u003e\u003c/a\u003e\n\n### onNotificationsPermissionLevelChanged\n\n```\nonNotificationsPermissionLevelChanged(callback: (level: string) =\u003e void): () =\u003e void\n```\n\nAdds a listener for when notification permission level changes.\n\n\u003ca name=\"offscreen\"\u003e\u003c/a\u003e\n\n## offscreen\n\n**Documentation:** [Chrome Offscreen API](https://developer.chrome.com/docs/extensions/reference/offscreen) [MV3]\n\nA promise-based wrapper for the Chrome `offscreen` API to create and manage offscreen documents.\n\n### Methods\n\n- [createOffscreen](#createOffscreen)\n- [closeOffscreen](#closeOffscreen)\n- [hasOffscreen](#hasOffscreen)\n\n\u003ca name=\"createOffscreen\"\u003e\u003c/a\u003e\n\n### createOffscreen\n\n```\ncreateOffscreen(parameters: chrome.offscreen.CreateParameters): Promise\u003cvoid\u003e\n```\n\nCreates an offscreen document with the specified parameters.\n\n\u003ca name=\"closeOffscreen\"\u003e\u003c/a\u003e\n\n### closeOffscreen\n\n```\ncloseOffscreen(): Promise\u003cvoid\u003e\n```\n\nCloses the existing offscreen document.\n\n\u003ca name=\"hasOffscreen\"\u003e\u003c/a\u003e\n\n### hasOffscreen\n\n```\nhasOffscreen(): Promise\u003cboolean\u003e\n```\n\nChecks whether an offscreen document is currently open.\n\n\u003ca name=\"permissions\"\u003e\u003c/a\u003e\n\n## permissions\n\n**Documentation:** [Chrome Permissions API](https://developer.chrome.com/docs/extensions/reference/permissions)\n\nA promise-based wrapper for the Chrome `permissions` API to request and manage extension permissions.\n\n### Methods\n\n- [containsPermissions](#containsPermissions)\n- [getAllPermissions](#getAllPermissions)\n- [requestPermissions](#requestPermissions)\n- [removePermissions](#removePermissions)\n- [addHostAccessRequest](#addHostAccessRequest) [MV3]\n- [removeHostAccessRequest](#removeHostAccessRequest) [MV3]\n\n### Events\n\n- [onPermissionsAdded](#onPermissionsAdded)\n- [onPermissionsRemoved](#onPermissionsRemoved)\n\n\u003ca name=\"containsPermissions\"\u003e\u003c/a\u003e\n\n### containsPermissions\n\n```\ncontainsPermissions(permissions: chrome.permissions.Permissions): Promise\u003cboolean\u003e\n```\n\nChecks whether the extension has the specified permissions.\n\n\u003ca name=\"getAllPermissions\"\u003e\u003c/a\u003e\n\n### getAllPermissions\n\n```\ngetAllPermissions(): Promise\u003cchrome.permissions.Permissions\u003e\n```\n\nRetrieves all granted permissions.\n\n\u003ca name=\"requestPermissions\"\u003e\u003c/a\u003e\n\n### requestPermissions\n\n```\nrequestPermissions(permissions: chrome.permissions.Permissions): Promise\u003cboolean\u003e\n```\n\nPrompts the user to grant additional permissions.\n\n\u003ca name=\"removePermissions\"\u003e\u003c/a\u003e\n\n### removePermissions\n\n```\nremovePermissions(permissions: chrome.permissions.Permissions): Promise\u003cboolean\u003e\n```\n\nRemoves the specified permissions if granted.\n\n\u003ca name=\"addHostAccessRequest\"\u003e\u003c/a\u003e\n\n### addHostAccessRequest [MV3]\n\n```\naddHostAccessRequest(request?: chrome.permissions.AddHostAccessRequest): Promise\u003cvoid\u003e\n```\n\nRequests additional host access at runtime (Manifest V3 only).\n\n\u003ca name=\"removeHostAccessRequest\"\u003e\u003c/a\u003e\n\n### removeHostAccessRequest [MV3]\n\n```\nremoveHostAccessRequest(request?: chrome.permissions.RemoveHostAccessRequest): Promise\u003cvoid\u003e\n```\n\nClears a previously requested host access (Manifest V3 only).\n\n\u003ca name=\"onPermissionsAdded\"\u003e\u003c/a\u003e\n\n### onPermissionsAdded\n\n```\nonPermissionsAdded(callback: (permissions: chrome.permissions.Permissions) =\u003e void): () =\u003e void\n```\n\nFires when new permissions are granted.\n\n\u003ca name=\"onPermissionsRemoved\"\u003e\u003c/a\u003e\n\n### onPermissionsRemoved\n\n```\nonPermissionsRemoved(callback: (permissions: chrome.permissions.Permissions) =\u003e void): () =\u003e void\n```\n\nFires when permissions are removed.\n\n\u003ca name=\"runtime\"\u003e\u003c/a\u003e\n\n## runtime\n\n**Documentation:** [Chrome Runtime API](https://developer.chrome.com/docs/extensions/reference/runtime)\n\nA wrapper for the Chrome `runtime` API, including messaging, updates, and lifecycle events.\n\n### Methods\n\n- [connect](#connect)\n- [connectNative](#connectNative)\n- [getContexts](#getContexts) [MV3]\n- [getManifest](#getManifest)\n- [getId](#getId)\n- [getManifestVersion](#getManifestVersion)\n- [isManifestVersion3](#isManifestVersion3)\n- [getPackageDirectoryEntry](#getPackageDirectoryEntry)\n- [getPlatformInfo](#getPlatformInfo)\n- [getBrowserInfo](#getBrowserInfo) [Firefox]\n- [getUrl](#getUrl)\n- [openOptionsPage](#openOptionsPage)\n- [reload](#reload)\n- [requestUpdateCheck](#requestUpdateCheck)\n- [restart](#restart) [MV3]\n- [restartAfterDelay](#restartAfterDelay) [MV3]\n- [sendMessage](#sendMessage)\n- [setUninstallUrl](#setUninstallUrl)\n\n### Events\n\n- [onConnect](#onConnect)\n- [onConnectExternal](#onConnectExternal)\n- [onInstalled](#onInstalled)\n- [onMessage](#onMessage)\n- [onMessageExternal](#onMessageExternal)\n- [onRestartRequired](#onRestartRequired)\n- [onStartup](#onStartup)\n- [onSuspend](#onSuspend)\n- [onSuspendCanceled](#onSuspendCanceled)\n- [onUpdateAvailable](#onUpdateAvailable)\n- [onUserScriptConnect](#onUserScriptConnect)\n- [onUserScriptMessage](#onUserScriptMessage)\n\n\u003ca name=\"connect\"\u003e\u003c/a\u003e\n\n### connect\n\n```\nconnect(extensionId: string, connectInfo?: object): chrome.runtime.Port\n```\n\nOpens a long-lived connection to another extension or app.\n\n\u003ca name=\"connectNative\"\u003e\u003c/a\u003e\n\n### connectNative\n\n```\nconnectNative(application: string): chrome.runtime.Port\n```\n\nConnects to a native application.\n\n\u003ca name=\"getContexts\"\u003e\u003c/a\u003e\n\n### getContexts [MV3]\n\n```\ngetContexts(filter: chrome.runtime.ContextFilter): Promise\u003cchrome.runtime.ExtensionContext[]\u003e\n```\n\nRetrieves extension contexts matching the filter (Manifest V3 only).\n\n\u003ca name=\"getManifest\"\u003e\u003c/a\u003e\n\n### getManifest\n\n```\ngetManifest(): chrome.runtime.Manifest\n```\n\nReturns the extension's manifest details.\n\n\u003ca name=\"getId\"\u003e\u003c/a\u003e\n\n### getId\n\n```\ngetId(): string\n```\n\nReturns the extension ID.\n\n\u003ca name=\"getManifestVersion\"\u003e\u003c/a\u003e\n\n### getManifestVersion\n\n```\ngetManifestVersion(): 2 | 3\n```\n\nRetrieves the manifest version (2 or 3).\n\n\u003ca name=\"isManifestVersion3\"\u003e\u003c/a\u003e\n\n### isManifestVersion3\n\n```\nisManifestVersion3(): boolean\n```\n\nChecks if the extension uses Manifest V3.\n\n\u003ca name=\"getPackageDirectoryEntry\"\u003e\u003c/a\u003e\n\n### getPackageDirectoryEntry\n\n```\ngetPackageDirectoryEntry(): Promise\u003cFileSystemDirectoryEntry\u003e\n```\n\nGets the root directory of the extension package.\n\n\u003ca name=\"getPlatformInfo\"\u003e\u003c/a\u003e\n\n### getPlatformInfo\n\n```\ngetPlatformInfo(): Promise\u003cchrome.runtime.PlatformInfo\u003e\n```\n\nReturns information about the current platform.\n\n\u003ca name=\"getBrowserInfo\"\u003e\u003c/a\u003e\n\n### getBrowserInfo\n\n```\ngetBrowserInfo(): Promise\u003c{ name: string; vendor: string; version: string; buildID: string;}\u003e\n```\n\nReturns information about browser. Only for Firefox\n\n\u003ca name=\"getUrl\"\u003e\u003c/a\u003e\n\n### getUrl\n\n```\ngetUrl(path: string): string\n```\n\nConverts a relative path to an absolute extension URL.\n\n\u003ca name=\"openOptionsPage\"\u003e\u003c/a\u003e\n\n### openOptionsPage\n\n```\nopenOptionsPage(): Promise\u003cvoid\u003e\n```\n\nOpens the extension's options page.\n\n\u003ca name=\"reload\"\u003e\u003c/a\u003e\n\n### reload\n\n```\nreload(): void\n```\n\nReloads the extension.\n\n\u003ca name=\"requestUpdateCheck\"\u003e\u003c/a\u003e\n\n### requestUpdateCheck\n\n```\nrequestUpdateCheck(): Promise\u003c{status: chrome.runtime.RequestUpdateCheckStatus; details?: chrome.runtime.UpdateCheckDetails;}\u003e\n```\n\nChecks for an update and returns status and details.\n\n\u003ca name=\"restart\"\u003e\u003c/a\u003e\n\n### restart [MV3]\n\n```\nrestart(): void\n```\n\nRestarts the browser to apply updates (Manifest V3 only).\n\n\u003ca name=\"restartAfterDelay\"\u003e\u003c/a\u003e\n\n### restartAfterDelay [MV3]\n\n```\nrestartAfterDelay(seconds: number): Promise\u003cvoid\u003e\n```\n\nSchedules a browser restart after the given delay in seconds (Manifest V3 only).\n\n\u003ca name=\"sendMessage\"\u003e\u003c/a\u003e\n\n### sendMessage\n\n```\nsendMessage\u003cM = any, R = any\u003e(message: M): Promise\u003cR\u003e\n```\n\nSends a single message to the extension or app and awaits a response.\n\n\u003ca name=\"setUninstallUrl\"\u003e\u003c/a\u003e\n\n### setUninstallUrl\n\n```\nsetUninstallUrl(url: string): Promise\u003cvoid\u003e\n```\n\nSets a URL to be opened upon uninstallation.\n\n\u003ca name=\"onConnect\"\u003e\u003c/a\u003e\n\n### onConnect\n\n```\nonConnect(callback: (port: chrome.runtime.Port) =\u003e void): () =\u003e void\n```\n\nFires when a connection is made by another extension or content script.\n\n\u003ca name=\"onConnectExternal\"\u003e\u003c/a\u003e\n\n### onConnectExternal\n\n```\nonConnectExternal(callback: (port: chrome.runtime.Port) =\u003e void): () =\u003e void\n```\n\nFires when an external extension connects.\n\n\u003ca name=\"onInstalled\"\u003e\u003c/a\u003e\n\n### onInstalled\n\n```\nonInstalled(callback: chrome.runtime.InstalledDetails): () =\u003e void\n```\n\nFires when the extension is installed or updated.\n\n\u003ca name=\"onMessage\"\u003e\u003c/a\u003e\n\n### onMessage\n\n```\nonMessage(callback: (message: any, sender: chrome.runtime.MessageSender) =\u003e void): () =\u003e void\n```\n\nFires when a message is received.\n\n\u003ca name=\"onMessageExternal\"\u003e\u003c/a\u003e\n\n### onMessageExternal\n\n```\nonMessageExternal(callback: (message: any, sender: chrome.runtime.MessageSender) =\u003e void): () =\u003e void\n```\n\nFires when an external extension sends a message.\n\n\u003ca name=\"onRestartRequired\"\u003e\u003c/a\u003e\n\n### onRestartRequired\n\n```\nonRestartRequired(callback: (reason: chrome.runtime.OnRestartRequiredReason) =\u003e void): () =\u003e void\n```\n\nFires when the extension requires a browser restart.\n\n\u003ca name=\"onStartup\"\u003e\u003c/a\u003e\n\n### onStartup\n\n```\nonStartup(callback: () =\u003e void): () =\u003e void\n```\n\nFires when the browser starts up.\n\n\u003ca name=\"onSuspend\"\u003e\u003c/a\u003e\n\n### onSuspend\n\n```\nonSuspend(callback: () =\u003e void): () =\u003e void\n```\n\nFires when the event page is about to be unloaded.\n\n\u003ca name=\"onSuspendCanceled\"\u003e\u003c/a\u003e\n\n### onSuspendCanceled\n\n```\nonSuspendCanceled(callback: () =\u003e void): () =\u003e void\n```\n\nFires when a suspend is canceled.\n\n\u003ca name=\"onUpdateAvailable\"\u003e\u003c/a\u003e\n\n### onUpdateAvailable\n\n```\nonUpdateAvailable(callback: chrome.runtime.UpdateAvailableDetails): () =\u003e void\n```\n\nFires when an update is available.\n\n\u003ca name=\"onUserScriptConnect\"\u003e\u003c/a\u003e\n\n### onUserScriptConnect\n\n```\nonUserScriptConnect(callback: (port: chrome.runtime.Port) =\u003e void): () =\u003e void\n```\n\nFires when a user script establishes a connection.\n\n\u003ca name=\"onUserScriptMessage\"\u003e\u003c/a\u003e\n\n### onUserScriptMessage\n\n```\nonUserScriptMessage(callback: (message: any, sender: chrome.runtime.MessageSender) =\u003e void): () =\u003e void\n```\n\nFires when a message arrives from a user script.\n\n\u003ca name=\"scripting\"\u003e\u003c/a\u003e\n\n## scripting\n\n**Documentation:** [Chrome Scripting API](https://developer.chrome.com/docs/extensions/reference/scripting)\n\nA promise-based wrapper for the Chrome `scripting` API to inject scripts and styles, and manage content scripts.\n\n### Methods\n\n- [executeScript](#executeScript)\n- [getRegisteredContentScripts](#getRegisteredContentScripts)\n- [insertCss](#insertCss)\n- [registerContentScripts](#registerContentScripts)\n- [removeCss](#removeCss)\n- [unregisterContentScripts](#unregisterContentScripts)\n- [updateContentScripts](#updateContentScripts)\n- [isAvailableScripting](#isAvailableScripting)\n\n\u003ca name=\"executeScript\"\u003e\u003c/a\u003e\n\n### executeScript\n\n```\nexecuteScript\u003cT = any\u003e(injection: chrome.scripting.ScriptInjection\u003cany, T\u003e): Promise\u003cchrome.scripting.InjectionResult\u003cchrome.scripting.Awaited\u003cT\u003e\u003e[]\u003e\n```\n\nExecutes a script in the specified target and returns the injection results.\n\n\u003ca name=\"getRegisteredContentScripts\"\u003e\u003c/a\u003e\n\n### getRegisteredContentScripts\n\n```\ngetRegisteredContentScripts(filter?: chrome.scripting.ContentScriptFilter): Promise\u003cchrome.scripting.RegisteredContentScript[]\u003e\n```\n\nRetrieves registered content scripts, optionally filtered by criteria.\n\n\u003ca name=\"insertCSS\"\u003e\u003c/a\u003e\n\n### insertCss\n\n```\ninsertCss(injection: chrome.scripting.CSSInjection): Promise\u003cvoid\u003e\n```\n\nInjects CSS into specified target pages.\n\n\u003ca name=\"registerContentScripts\"\u003e\u003c/a\u003e\n\n### registerContentScripts\n\n```\nregisterContentScripts(scripts: chrome.scripting.RegisteredContentScript[]): Promise\u003cvoid\u003e\n```\n\nRegisters one or more content scripts programmatically.\n\n\u003ca name=\"removeCss\"\u003e\u003c/a\u003e\n\n### removeCss\n\n```\nremoveCss(injection: chrome.scripting.CSSInjection): Promise\u003cvoid\u003e\n```\n\nRemoves previously injected CSS from specified target pages.\n\n\u003ca name=\"unregisterContentScripts\"\u003e\u003c/a\u003e\n\n### unregisterContentScripts\n\n```\nunregisterContentScripts(filter?: chrome.scripting.ContentScriptFilter): Promise\u003cvoid\u003e\n```\n\nUnregisters content scripts matching the given filter.\n\n\u003ca name=\"updateContentScripts\"\u003e\u003c/a\u003e\n\n### updateContentScripts\n\n```\nupdateContentScripts(scripts: chrome.scripting.RegisteredContentScript[]): Promise\u003cvoid\u003e\n```\n\nUpdates existing content scripts with new definitions.\n\n\u003ca name=\"isAvailableScripting\"\u003e\u003c/a\u003e\n\n### isAvailableScripting\n\n```\nisAvailableScripting(): boolean\n```\n\nChecks if the Scripting API is available in the current browser.\n\n\u003ca name=\"sidebar\"\u003e\u003c/a\u003e\n\n## sidebar\n\n**Documentation:**\n\n- [Chrome Side Panel API](https://developer.chrome.com/docs/extensions/reference/sidePanel) [MV3]\n- [Opera Sidebar Action API](https://help.opera.com/en/extensions/sidebar-action-api/)\n- [Firefox Sidebar Action API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/sidebarAction)\n\nA promise-based wrapper for the Chrome `sidePanel` API and the `sidebarAction` API in Firefox/Opera. Provides methods to get and set side panel options, behavior, path, title, and badge.\n\n### Methods\n\n- [getSidebarOptions](#getSidebarOptions)\n- [getSidebarBehavior](#getSidebarBehavior)\n- [canOpenSidebar](#canOpenSidebar)\n- [openSidebar](#openSidebar)\n- [setSidebarOptions](#setSidebarOptions)\n- [setSidebarBehavior](#setSidebarBehavior)\n- [setSidebarPath](#setSidebarPath)\n- [getSidebarPath](#getSidebarPath)\n- [setSidebarTitle](#setSidebarTitle) [Opera]\n- [setSidebarBadgeText](#setSidebarBadgeText) [Opera]\n- [setSidebarBadgeTextColor](#setSidebarBadgeTextColor) [Opera]\n- [setSidebarBadgeBgColor](#getSidebarBadgeBgColor) [Opera]\n- [getSidebarTitle](#getSidebarTitle) [Opera]\n- [getSidebarBadgeText](#getSidebarBadgeText) [Opera]\n- [getSidebarBadgeTextColor](#getSidebarBadgeTextColor) [Opera]\n- [getSidebarBadgeBgColor](#getSidebarBadgeBgColor) [Opera]\n\n\u003ca name=\"getSidebarOptions\"\u003e\u003c/a\u003e\n\n### getSidebarOptions\n\n```\ngetSidebarOptions(tabId?: number): Promise\u003cchrome.sidePanel.PanelOptions\u003e\n```\n\nRetrieves the panel options (such as `path` and other settings) for the specified tab's side panel. Throws an error if the Side Panel API is not supported. [MV3]\n\n\u003ca name=\"getSidebarBehavior\"\u003e\u003c/a\u003e\n\n### getSidebarBehavior\n\n```\ngetSidebarBehavior(): Promise\u003cchrome.sidePanel.PanelBehavior\u003e\n```\n\nFetches the current behavior settings of the side panel (e.g., default open state). Throws an error if the API is not supported. [MV3]\n\n\u003ca name=\"canOpenSidebar\"\u003e\u003c/a\u003e\n\n### canOpenSidebar\n\n```\ncanOpenSidebar(): boolean\n```\n\nReturns `true` if the side panel (Chrome MV3) or sidebar action (Firefox/Opera) APIs are available, indicating the extension can programmatically open the sidebar.\n\n\u003ca name=\"openSidebar\"\u003e\u003c/a\u003e\n\n### openSidebar\n\n```\nopenSidebar(options: chrome.sidePanel.OpenOptions): Promise\u003cvoid\u003e\n```\n\nOpens the side panel with the specified options in Chrome (Manifest V3). Falls back to `browser.sidebarAction.open()` in Firefox. Logs a warning if unsupported.\n\n\u003ca name=\"setSidebarOptions\"\u003e\u003c/a\u003e\n\n### setSidebarOptions\n\n```\nsetSidebarOptions(options?: chrome.sidePanel.PanelOptions): Promise\u003cvoid\u003e\n```\n\nSets new panel options (e.g., `path`) for the side panel in Chrome (Manifest V3). Logs a warning if unsupported. [MV3]\n\n\u003ca name=\"setSidebarBehavior\"\u003e\u003c/a\u003e\n\n### setSidebarBehavior\n\n```\nsetSidebarBehavior(behavior?: chrome.sidePanel.PanelBehavior): Promise\u003cvoid\u003e\n```\n\nUpdates the panel behavior settings in Chrome (Manifest V3). Logs a warning if unsupported. [MV3]\n\n\u003ca name=\"setSidebarPath\"\u003e\u003c/a\u003e\n\n### setSidebarPath\n\n```\nsetSidebarPath(path: string, tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the URL path of the sidebar panel. Uses Chrome `setOptions` in MV3 or `sidebarAction.setPanel()` in Firefox/Opera. Throws if unsupported.\n\n\u003ca name=\"getSidebarPath\"\u003e\u003c/a\u003e\n\n### getSidebarPath\n\n```\ngetSidebarPath(tabId?: number): Promise\u003cstring | undefined\u003e\n```\n\nRetrieves the current sidebar panel path from Chrome MV3 or parses it from the `sidebarAction.getPanel()` result in Firefox/Opera. Throws if unsupported.\n\n\u003ca name=\"setSidebarTitle\"\u003e\u003c/a\u003e\n\n### setSidebarTitle\n\n```\nsetSidebarTitle(title: string | number, tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the sidebar title in Opera via `opr.sidebarAction.setTitle()`. Logs a warning if unsupported. [Opera]\n\n\u003ca name=\"setSidebarBadgeText\"\u003e\u003c/a\u003e\n\n### setSidebarBadgeText\n\n```\nsetSidebarBadgeText(text: string | number, tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the sidebar badge text in Opera via `opr.sidebarAction.setBadgeText()`. Logs a warning if unsupported. [Opera]\n\n\u003ca name=\"setSidebarBadgeTextColor\"\u003e\u003c/a\u003e\n\n### setSidebarBadgeTextColor\n\n```\nsetSidebarBadgeTextColor(color: string | number[] | chrome.action.ColorArray, tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the sidebar badge text color in Opera via `opr.sidebarAction.setBadgeTextColor()`. Logs a warning if unsupported. [Opera]\n\n\u003ca name=\"setSidebarBadgeBgColor\"\u003e\u003c/a\u003e\n\n### setSidebarBadgeBgColor\n\n```\nsetSidebarBadgeBgColor(color: string | number[] | chrome.action.ColorArray, tabId?: number): Promise\u003cvoid\u003e\n```\n\nSets the sidebar badge background color in Opera via `opr.sidebarAction.setBadgeBackgroundColor()`. Logs a warning if unsupported. [Opera]\n\n\u003ca name=\"getSidebarTitle\"\u003e\u003c/a\u003e\n\n### getSidebarTitle\n\n```\ngetSidebarTitle(tabId?: number): Promise\u003cstring\u003e\n```\n\nRetrieves the sidebar title in Opera via `opr.sidebarAction.getTitle()`. Throws an error if unsupported. [Opera]\n\n\u003ca name=\"getSidebarBadgeText\"\u003e\u003c/a\u003e\n\n### getSidebarBadgeText\n\n```\ngetSidebarBadgeText(tabId?: number): Promise\u003cstring\u003e\n```\n\nRetrieves the sidebar badge text in Opera via `opr.sidebarAction.getBadgeText()`. Throws an error if unsupported. [Opera]\n\n\u003ca name=\"getSidebarBadgeTextColor\"\u003e\u003c/a\u003e\n\n### getSidebarBadgeTextColor\n\n```\ngetSidebarBadgeTextColor(tabId?: number): Promise\u003cchrome.action.ColorArray\u003e\n```\n\nRetrieves the sidebar badge text color in Opera via `opr.sidebarAction.getBadgeTextColor()`. Throws an error if unsupported. [Opera]\n\n\u003ca name=\"getSidebarBadgeBgColor\"\u003e\u003c/a\u003e\n\n### getSidebarBadgeBgColor\n\n```\ngetSidebarBadgeBgColor(tabId?: number): Promise\u003cchrome.action.ColorArray\u003e\n```\n\nRetrieves the sidebar badge background color in Opera via `opr.sidebarAction.getBadgeBackgroundColor()`. Throws an error if unsupported. [Opera]\n\n\u003ca name=\"tabCapture\"\u003e\u003c/a\u003e\n\n## tabCapture\n\n**Documentation:** [Chrome Tab Capture API](https://developer.chrome.com/docs/extensions/reference/tabCapture)\n\nA promise-based wrapper for the Chrome `tabCapture` API to capture and retrieve tab media streams.\n\n### Methods\n\n- [createTabCapture](#createTabCapture)\n- [getCapturedTabs](#getCapturedTabs)\n- [getCaptureMediaStreamId](#getCaptureMediaStreamId)\n\n### Events\n\n- [onCaptureStatusChanged](#onCaptureStatusChanged)\n\n\u003ca name=\"createTabCapture\"\u003e\u003c/a\u003e\n\n### createTabCapture\n\n```\ncreateTabCapture(options: chrome.tabCapture.CaptureOptions): Promise\u003cMediaStream | null\u003e\n```\n\nCaptures the visible media stream of a tab based on the specified options. Resolves with the `MediaStream` if successful, or `null` otherwise. Rejects if an error occurs.\n\n\u003ca name=\"getCapturedTabs\"\u003e\u003c/a\u003e\n\n### getCapturedTabs\n\n```\ngetCapturedTabs(): Promise\u003cchrome.tabCapture.CaptureInfo[]\u003e\n```\n\nRetrieves details of all active tab capture sessions. Resolves with an array of `CaptureInfo` objects.\n\n\u003ca name=\"getCaptureMediaStreamId\"\u003e\u003c/a\u003e\n\n### getCaptureMediaStreamId\n\n```\ngetCaptureMediaStreamId(options: chrome.tabCapture.GetMediaStreamOptions): Promise\u003cstring\u003e\n```\n\nGenerates a media stream ID for capturing a tab via `navigator.mediaDevices.getUserMedia`. Resolves with the stream ID.\n\n\u003ca name=\"onCaptureStatusChanged\"\u003e\u003c/a\u003e\n\n### onCaptureStatusChanged\n\n```\nonCaptureStatusChanged(callback: (info: chrome.tabCapture.CaptureInfo) =\u003e void): () =\u003e void\n```\n\nAdds a listener for tab capture status changes (started, stopped, source changed). Returns a function to remove the listener.\n\n\u003ca name=\"tabs\"\u003e\u003c/a\u003e\n\n## tabs\n\n**Documentation:** [Chrome Tabs API](https://developer.chrome.com/docs/extensions/reference/tabs)\n\nA promise-based wrapper for the Chrome `tabs` API, providing core tab operations, messaging, and utility methods.\n\n### Methods\n\n- [captureVisibleTab](#captureVisibleTab)\n- [connectTab](#connectTab)\n- [createTab](#createTab)\n- [detectTabLanguage](#detectTabLanguage)\n- [discardTab](#discardTab)\n- [duplicateTab](#duplicateTab)\n- [getTab](#getTab)\n- [getCurrentTab](#getCurrentTab)\n- [getTabZoom](#getTabZoom)\n- [getTabZoomSettings](#getTabZoomSettings)\n- [goTabBack](#goTabBack)\n- [goTabForward](#goTabForward)\n- [groupTabs](#groupTabs)\n- [highlightTab](#highlightTab)\n- [moveTab](#moveTab)\n- [moveTabs](#moveTabs)\n- [queryTabs](#queryTabs)\n- [reloadTab](#reloadTab)\n- [removeTab](#removeTab)\n- [sendTabMessage](#sendTabMessage)\n- [setTabZoom](#setTabZoom)\n- [setTabZoomSettings](#setTabZoomSettings)\n- [ungroupTab](#ungroupTab)\n- [updateTab](#updateTab)\n- [executeScriptTab](#executeScriptTab) [MV2]\n- [insertCssTab](#insertCssTab) [MV2]\n- [removeCssTab](#removeCssTab) [MV2]\n- [getTabUrl](#getTabUrl)\n- [getActiveTab](#getActiveTab)\n- [queryTabIds](#queryTabIds)\n- [findTab](#findTab)\n- [findTabById](#findTabById)\n- [updateTabAsSelected](#updateTabAsSelected)\n- [updateTabAsActive](#updateTabAsActive)\n- [openOrCreateTab](#openOrCreateTab)\n\n### Events\n\n- [onTabActivated](#onTabActivated)\n- [onTabAttached](#onTabAttached)\n- [onTabCreated](#onTabCreated)\n- [onTabDetached](#onTabDetached)\n- [onTabHighlighted](#onTabHighlighted)\n- [onTabMoved](#onTabMoved)\n- [onTabRemoved](#onTabRemoved)\n- [onTabReplaced](#onTabReplaced)\n- [onTabUpdated](#onTabUpdated)\n- [onTabZoomChange](#onTabZoomChange)\n\n\u003ca name=\"captureVisibleTab\"\u003e\u003c/a\u003e\n\n### captureVisibleTab\n\n```\ncaptureVisibleTab(windowId: number, options: chrome.extensionTypes.ImageDetails): Promise\u003cstring\u003e\n```\n\nCaptures the visible area of the specified window as an image and returns a data URL string. Resolves with the image `data:image/png;base64,...`.\n\n\u003ca name=\"connectTab\"\u003e\u003c/a\u003e\n\n### connectTab\n\n```\nconnectTab(tabId: number, connectInfo?: chrome.tabs.ConnectInfo): chrome.runtime.Port\n```\n\nCreates a long-lived connection to the specified tab for message passing. Returns a `Port` object.\n\n\u003ca name=\"createTab\"\u003e\u003c/a\u003e\n\n### createTab\n\n```\ncreateTab(properties: chrome.tabs.CreateProperties): Promise\u003cchrome.tabs.Tab\u003e\n```\n\nCreates a new tab with the given properties. Resolves with the created `Tab` object.\n\n\u003ca name=\"detectTabLanguage\"\u003e\u003c/a\u003e\n\n### detectTabLanguage\n\n```\ndetectTabLanguage(tabId: number): Promise\u003cstring\u003e\n```\n\nDetects the language of the specified tab's content. Resolves with a language code (e.g., `\"en\"` or `\"und\"`).\n\n\u003ca name=\"discardTab\"\u003e\u003c/a\u003e\n\n### discardTab\n\n```\ndiscardTab(tabId: number): Promise\u003cchrome.tabs.Tab\u003e\n```\n\nDiscards the specified tab to free up system resources. Resolves with the updated `Tab` object.\n\n\u003ca name=\"duplicateTab\"\u003e\u003c/a\u003e\n\n### duplicateTab\n\n```\nduplicateTab(tabId: number): Promise\u003cchrome.tabs.Tab | undefined\u003e\n```\n\nDuplicates the specified tab, opening a copy. Resolves with the new `Tab`, or `undefined` if duplication fails.\n\n\u003ca name=\"getTab\"\u003e\u003c/a\u003e\n\n### getTab\n\n```\ngetTab(tabId: number): Promise\u003cchrome.tabs.Tab\u003e\n```\n\nRetrieves information about the specified tab. Resolves with the `Tab` object.\n\n\u003ca name=\"getCurrentTab\"\u003e\u003c/a\u003e\n\n### getCurrentTab\n\n```\ngetCurrentTab(): Promise\u003cchrome.tabs.Tab | undefined\u003e\n```\n\nRetrieves the tab in which the script is running (e.g., popup or content script). Resolves with the `Tab` or `undefined` if not called in a tab context.\n\n\u003ca name=\"getTabZoom\"\u003e\u003c/a\u003e\n\n### getTabZoom\n\n```\ngetTabZoom(tabId: number): Promise\u003cnumber\u003e\n```\n\nGets the zoom factor of the specified tab. Resolves with the zoom level (e.g., `1.0`).\n\n\u003ca name=\"getTabZoomSettings\"\u003e\u003c/a\u003e\n\n### getTabZoomSettings\n\n```\ngetTabZoomSettings(tabId: number): Promise\u003cchrome.tabs.ZoomSettings\u003e\n```\n\nRetrieves the zoom settings of the specified tab. Resolves with a `ZoomSettings` object.\n\n\u003ca name=\"goTabBack\"\u003e\u003c/a\u003e\n\n### goTabBack\n\n```\ngoTabBack(tabId: number): Promise\u003cvoid\u003e\n```\n\nNavigates the specified tab one step backward in its history.\n\n\u003ca name=\"goTabForward\"\u003e\u003c/a\u003e\n\n### goTabForward\n\n```\ngoTabForward(tabId: number): Promise\u003cvoid\u003e\n```\n\nNavigates the specified tab one step forward in its history.\n\n\u003ca name=\"groupTabs\"\u003e\u003c/a\u003e\n\n### groupTabs\n\n```\ngroupTabs(options: chrome.tabs.GroupOptions): Promise\u003cnumber\u003e\n```\n\nGroups one or more tabs into a single tab group. Resolves with the group ID.\n\n\u003ca name=\"highlightTab\"\u003e\u003c/a\u003e\n\n### highlightTab\n\n```\nhighlightTab(highlightInfo: chrome.tabs.HighlightInfo): Promise\u003cchrome.windows.Window\u003e\n```\n\nHighlights (selects) the specified tabs within a window. Resolves with the updated `Window`.\n\n\u003ca name=\"moveTab\"\u003e\u003c/a\u003e\n\n### moveTab\n\n```\nmoveTab(tabId: number, moveProperties: chrome.tabs.MoveProperties): Promise\u003cchrome.tabs.Tab\u003e\n```\n\nMoves a tab to a new index or window. Resolves with the moved `Tab`.\n\n\u003ca name=\"moveTabs\"\u003e\u003c/a\u003e\n\n### moveTabs\n\n```\nmoveTabs(tabIds: number[], moveProperties: chrome.tabs.MoveProperties): Promise\u003cchrome.tabs.Tab[]\u003e\n```\n\nMoves multiple tabs to new positions. Resolves with an array of updated `Tab` objects.\n\n\u003ca name=\"queryTabs\"\u003e\u003c/a\u003e\n\n### queryTabs\n\n```\nqueryTabs(queryInfo?: chrome.tabs.QueryInfo): Promise\u003cchrome.tabs.Tab[]\u003e\n```\n\nRetrieves all tabs that match the given query filters. Resolves with an array of `Tab` objects.\n\n\u003ca name=\"reloadTab\"\u003e\u003c/a\u003e\n\n### reloadTab\n\n```\nreloadTab(tabId: number, bypassCache?: boolean): Promise\u003cvoid\u003e\n```\n\nReloads the specified tab. If `bypassCache` is `true`, forces resource revalidation.\n\n\u003ca name=\"removeTab\"\u003e\u003c/a\u003e\n\n### removeTab\n\n```\nremoveTab(tabId: number): Promise\u003cvoid\u003e\n```\n\nCloses the specified tab.\n\n\u003ca name=\"sendTabMessage\"\u003e\u003c/a\u003e\n\n### sendTabMessage\n\n```\nsendTabMessage\u003cM = any, R = any\u003e(tabId: number, message: M, options?: chrome.tabs.MessageSendOptions): Promise\u003cR\u003e\n```\n\nSends a one-time message to the content script in the specified tab. Resolves with the response.\n\n\u003ca name=\"setTabZoom\"\u003e\u003c/a\u003e\n\n### setTabZoom\n\n```\nsetTabZoom(tabId: number, zoomFactor: number): Promise\u003cvoid\u003e\n```\n\nSets the zoom factor for the specified tab.\n\n\u003ca name=\"setTabZoomSettings\"\u003e\u003c/a\u003e\n\n### setTabZoomSettings\n\n```\nsetTabZoomSettings(tabId: number, zoomSettings: chrome.tabs.ZoomSettings): Promise\u003cvoid\u003e\n```\n\nUpdates the zoom settings for the specified tab.\n\n\u003ca name=\"ungroupTab\"\u003e\u003c/a\u003e\n\n### ungroupTab\n\n```\nungroupTab(tabIds: number | number[]): Promise\u003cvoid\u003e\n```\n\nRemoves one or more tabs from their group.\n\n\u003ca name=\"updateTab\"\u003e\u003c/a\u003e\n\n### updateTab\n\n```\nupdateTab(tabId: number, updateProperties: chrome.tabs.UpdateProperties): Promise\u003cchrome.tabs.Tab | undefined\u003e\n```\n\nUpdates properties of the specified tab (e.g., URL, active state). Resolves with the updated `Tab` or `undefined`.\n\n\u003ca name=\"executeScriptTab\"\u003e\u003c/a\u003e\n\n### executeScriptTab\n\n```\nexecuteScriptTab(tabId: number, details: chrome.extensionTypes.InjectDetails): Promise\u003cany[]\u003e\n```\n\nInjects JavaScript into the specified tab and returns execution results. (Manifest V2 only).\n\n\u003ca name=\"insertCssTab\"\u003e\u003c/a\u003e\n\n### insertCssTab\n\n```\ninsertCssTab(tabId: number, details: chrome.extensionTypes.InjectDetails): Promise\u003cvoid\u003e\n```\n\nInjects CSS into a page. (Manifest V2 only).\n\n\u003ca name=\"insertCssTab\"\u003e\u003c/a\u003e\n\n### removeCssTab\n\n```\nremoveCssTab(tabId: number, details: chrome.extensionTypes.InjectDetails): Promise\u003cvoid\u003e\n```\n\nRemoves from a page CSS that was previously injected by a call to `insertCssTab`. (Manifest V2 only).\n\n\u003ca name=\"getTabUrl\"\u003e\u003c/a\u003e\n\n### getTabUrl\n\n```\ngetTabUrl(tabId: number): Promise\u003cstring\u003e\n```\n\nRetrieves the URL of the specified tab. Rejects if the tab does not exist or has no URL.\n\n\u003ca name=\"getActiveTab\"\u003e\u003c/a\u003e\n\n### getActiveTab\n\n```\ngetActiveTab(): Promise\u003cchrome.tabs.Tab\u003e\n```\n\nGets the currently active tab in the current window. Rejects if no active tab is found.\n\n\u003ca name=\"queryTabIds\"\u003e\u003c/a\u003e\n\n### queryTabIds\n\n```\nqueryTabIds(queryInfo?: chrome.tabs.QueryInfo): Promise\u003cnumber[]\u003e\n```\n\nRetrieves IDs of tabs matching the given query.\n\n\u003ca name=\"findTab\"\u003e\u003c/a\u003e\n\n### findTab\n\n```\nfindTab(queryInfo?: chrome.tabs.QueryInfo): Promise\u003cchrome.tabs.Tab | undefined\u003e\n```\n\nFinds the first tab matching the query. Resolves with the `Tab` or `undefined`.\n\n\u003ca name=\"findTabById\"\u003e\u003c/a\u003e\n\n### findTabById\n\n```\nfindTabById(tabId: number): Promise\u003cchrome.tabs.Tab | undefined\u003e\n```\n\nFinds a tab by its ID, or resolves with `undefined` if not found.\n\n\u003ca name=\"updateTabAsSelected\"\u003e\u003c/a\u003e\n\n### updateTabAsSelected\n\n```\nupdateTabAsSelected(tabId: number): Promise\u003cchrome.tabs.Tab | undefined\u003e\n```\n\nHighlights the specified tab, making it selected.\n\n\u003ca name=\"updateTabAsActive\"\u003e\u003c/a\u003e\n\n### updateTabAsActive\n\n```\nupdateTabAsActive(tabId: number): Promise\u003cchrome.tabs.Tab | undefined\u003e\n```\n\nSets the specified tab as active.\n\n\u003ca name=\"openOrCreateTab\"\u003e\u003c/a\u003e\n\n### openOrCreateTab\n\n```\nopenOrCreateTab(tab: chrome.tabs.Tab): Promise\u003cvoid\u003e\n```\n\nIf a tab with the same URL exists, activates it; otherwise, creates a new tab.\n\n\u003ca name=\"onTabActivated\"\u003e\u003c/a\u003e\n\n### onTabActivated\n\n```\nonTabActivated(callback: (activeInfo: chrome.tabs.TabActiveInfo) =\u003e void): () =\u003e void\n```\n\nFires when the active tab in a window changes. Returns a function to remove the listener.\n\n\u003ca name=\"onTabAttached\"\u003e\u003c/a\u003e\n\n### onTabAttached\n\n```\nonTabAttached(callback: (info: chrome.tabs.TabAttachedInfo) =\u003e void): () =\u003e void\n```\n\nFires when a tab is attached to a window. Returns a function to remove the listener.\n\n\u003ca name=\"onTabCreated\"\u003e\u003c/a\u003e\n\n### onTabCreated\n\n```\nonTabCreated(callback: (tab: chrome.tabs.Tab) =\u003e void): () =\u003e void\n```\n\nFires when a new tab is created. Returns a function to remove the listener.\n\n\u003ca name=\"onTabDetached\"\u003e\u003c/a\u003e\n\n### onTabDetached\n\n```\nonTabDetached(callback: (info: chrome.tabs.TabDetachedInfo) =\u003e void): () =\u003e void\n```\n\nFires when a tab is detached from a window. Returns a function to remove the listener.\n\n\u003ca name=\"onTabHighlighted\"\u003e\u003c/a\u003e\n\n### onTabHighlighted\n\n```\nonTabHighlighted(callback: (highlightInfo: chrome.tabs.TabHighlightInfo) =\u003e void): () =\u003e void\n```\n\nFires when the highlighted status of tabs in a window changes. Returns a function to remove the listener.\n\n\u003ca name=\"onTabMoved\"\u003e\u003c/a\u003e\n\n### onTabMoved\n\n```\nonTabMoved(callback: (moveInfo: chrome.tabs.TabMoveInfo) =\u003e void): () =\u003e void\n```\n\nFires when a tab is moved within a window. Returns a function to remove the listener.\n\n\u003ca name=\"onTabRemoved\"\u003e\u003c/a\u003e\n\n### onTabRemoved\n\n```\nonTabRemoved(callback: (tabId: number, removeInfo: chrome.tabs.TabRemoveInfo) =\u003e void): () =\u003e void\n```\n\nFires when a tab is closed. Returns a function to remove the listener.\n\n\u003ca name=\"onTabReplaced\"\u003e\u003c/a\u003e\n\n### onTabReplaced\n\n```\nonTabReplaced(callback: (addedTabId: number, removedTabId: number) =\u003e void): () =\u003e void\n```\n\nFires when one tab replaces another. Returns a function to remove the listener.\n\n\u003ca name=\"onTabUpdated\"\u003e\u003c/a\u003e\n\n### onTabUpdated\n\n```\nonTabUpdated(callback: (tabId: number, changeInfo: chrome.tabs.TabChangeInfo, tab: chrome.tabs.Tab) =\u003e void): () =\u003e void\n```\n\nFires when a tab is updated (e.g., URL change, status). Returns a function to remove the listener.\n\n\u003ca name=\"onTabZoomChange\"\u003e\u003c/a\u003e\n\n### onTabZoomChange\n\n```\nonTabZoomChange(callback: (zoomChangeInfo: chrome.tabs.ZoomChangeInfo) =\u003e void): () =\u003e void\n```\n\nFires when the zoom level of a tab changes. Returns a function to remove the listener.\n\n- [onTabActivated](#onTabActivated)\n- [onTabAttached](#onTabAttached)\n- [onTabCreated](#onTabCreated)\n- [onTabDetached](#onTabDetached)\n- [onTabHighlighted](#onTabHighlighted)\n- [onTabMoved](#onTabMoved)\n- [onTabRemoved](#onTabRemoved)\n- [onTabReplaced](#onTabReplaced)\n- [onTabUpdated](#onTabUpdated)\n- [onTabZoomChange](#onTabZoomChange)\n\n\u003ca name=\"userscripts\"\u003e\u003c/a\u003e\n\n## userScripts\n\n**Documentation:** [Chrome User Scripts API](https://developer.chrome.com/docs/extensions/reference/userScripts)\n\nA promise-based wrapper for the Chrome `userScripts` API, providing methods to configure worlds, register, retrieve, update, and unregister user scripts.\n\n### Methods\n\n- [configureUserScriptsWorld(properties)](#configureUserScriptsWorld)\n- [getUserScripts(ids)](#getUserScripts)\n- [getUserScriptsWorldConfigs()](#getUserScriptsWorldConfigs)\n- [registerUserScripts(scripts)](#registerUserScripts)\n- [resetUserScriptsWorldConfigs(worldId)](#resetUserScriptsWorldConfigs)\n- [unregisterUserScripts(ids)](#unregisterUserScripts)\n- [updateUserScripts(scripts)](#updateUserScripts)\n\n\u003ca name=\"configureUserScriptsWorld\"\u003e\u003c/a\u003e\n\n### configureUserScriptsWorld\n\n```\nconfigureUserScriptsWorld(properties?: chrome.userScripts.WorldProperties): Promise\u003cvoid\u003e\n```\n\nConfigures the execution context for user scripts by setting world properties. Must be called before registering or executing scripts.\n\n\u003ca name=\"getUserScripts\"\u003e\u003c/a\u003e\n\n### getUserScripts\n\n```\ngetUserScripts(ids?: string[]): Promise\u003cchrome.userScripts.RegisteredUserScript[]\u003e\n```\n\nRetrieves registered user scripts, optionally filtered by script IDs.\n\n\u003ca name=\"getUserScriptsWorldConfigs\"\u003e\u003c/a\u003e\n\n### getUserScriptsWorldConfigs\n\n```\ngetUserScriptsWorldConfigs(): Promise\u003cchrome.userScripts.WorldProperties[]\u003e\n```\n\nReturns configurations for all script execution worlds.\n\n\u003ca name=\"registerUserScripts\"\u003e\u003c/a\u003e\n\n### registerUserScripts\n\n```\nregisterUserScripts(scripts: chrome.userScripts.RegisteredUserScript[]): Promise\u003cvoid\u003e\n```\n\nRegisters one or more user scripts with the browser.\n\n\u003ca name=\"resetUserScriptsWorldConfigs\"\u003e\u003c/a\u003e\n\n### resetUserScriptsWorldConfigs\n\n```\nresetUserScriptsWorldConfigs(worldId: string): Promise\u003cvoid\u003e\n```\n\nResets the configuration of a specific world back to default settings.\n\n\u003ca name=\"unregisterUserScripts\"\u003e\u003c/a\u003e\n\n### unregisterUserScripts\n\n```\nunregisterUserScripts(ids?: string[]): Promise\u003cvoid\u003e\n```\n\nUnregisters user scripts by ID. If no IDs provided, all scripts are unregistered.\n\n\u003ca name=\"updateUserScripts\"\u003e\u003c/a\u003e\n\n### updateUserScripts\n\n```\nupdateUserScripts(scripts: chrome.userScripts.RegisteredUserScript[]): Promise\u003cvoid\u003e\n```\n\nUpdates existing user scripts with new definitions or metadata.\n\n\u003ca name=\"webnavigation\"\u003e\u003c/a\u003e\n\n## webNavigation\n\n**Documentation:** [Chrome WebNavigation API](https://developer.chrome.com/docs/extensions/reference/webNavigation)\n\nA promise-based wrapper for the Chrome `webNavigation` API, providing methods to retrieve frame information and listen to navigation events.\n\n### Methods\n\n- [getAllFrames(tabId)](#getAllFrames)\n- [getFrame(details)](#getFrame)\n\n### Events\n\n- [onWebNavigationBeforeNavigate(callback, filters)](#onWebNavigationBeforeNavigate)\n- [onWebNavigationCommitted(callback, filters)](#onWebNavigationCommitted)\n- [onWebNavigationCompleted(callback, filters)](#onWebNavigationCompleted)\n- [onWebNavigationCreatedNavigationTarget(callback, filters)](#onWebNavigationCreatedNavigationTarget)\n- [onWebNavigationDOMContentLoaded(callback, filters)](#onWebNavigationDOMContentLoaded)\n- [onWebNavigationErrorOccurred(callback, filters)](#onWebNavigationErrorOccurred)\n- [onWebNavigationHistoryStateUpdated(callback, filters)](#onWebNavigationHistoryStateUpdated)\n- [onWebNavigationReferenceFragmentUpdated(callback, filters)](#onWebNavigationReferenceFragmentUpdated)\n- [onWebNavigationTabReplaced(callback)](#onWebNavigationTabReplaced)\n\n\u003ca name=\"getAllFrames\"\u003e\u003c/a\u003e\n\n### getAllFrames\n\n```\ngetAllFrames(tabId: number): Promise\u003cchrome.webNavigation.GetAllFrameResultDetails[]\u003e\n```\n\nRetrieves information about all frames in the specified tab.\n\n\u003ca name=\"getFrame\"\u003e\u003c/a\u003e\n\n### getFrame\n\n```\ngetFrame(details: chrome.webNavigation.GetFrameDetails): Promise\u003cchrome.webNavigation.GetFrameResultDetails | null\u003e\n```\n\nRetrieves information about a specific frame. Rejects if the frame is not found.\n\n\u003ca name=\"onWebNavigationBeforeNavigate\"\u003e\u003c/a\u003e\n\n### onWebNavigationBeforeNavigate\n\n```\nonWebNavigationBeforeNavigate(callback: (details: chrome.webNavigation.WebNavigationParentedCallbackDetails) =\u003e void, filters?: chrome.webNavigation.WebNavigationEventFilter): () =\u003e void\n```\n\nAdds a listener that is called before a navigation occurs.\n\n\u003ca name=\"onWebNavigationCommitted\"\u003e\u003c/a\u003e\n\n### onWebNavigationCommitted\n\n```\nonWebNavigationCommitted(callback: (details: chrome.webNavigation.WebNavigationTransitionCallbackDetails) =\u003e void, filters?: chrome.webNavigation.WebNavigationEventFilter): () =\u003e void\n```\n\nAdds a listener that is called when a navigation is committed.\n\n\u003ca name=\"onWebNavigationCompleted\"\u003e\u003c/a\u003e\n\n### onWebNavigationCompleted\n\n```\nonWebNavigationCompleted(callback: (details: chrome.webNavigation.WebNavigationFramedCallbackDetails) =\u003e void, filters?: chrome.webNavigation.WebNavigationEventFilter): () =\u003e void\n```\n\nAdds a listener that is called when a document, including its resources, is completely loaded.\n\n\u003ca name=\"onWebNavigationCreatedNavigationTarget\"\u003e\u003c/a\u003e\n\n### onWebNavigationCreatedNavigationTarget\n\n```\nonWebNavigationCreatedNavigationTarget(callback: (details: chrome.webNavigation.WebNavigationSourceCallbackDetails) =\u003e void, filters?: chrome.webNavigation.WebNavigationEventFilter): () =\u003e void\n```\n\nAdds a listener that is called when a new window or tab is created to host a navigation.\n\n\u003ca name=\"onWebNavigationDOMContentLoaded\"\u003e\u003c/a\u003e\n\n### onWebNavigationDOMContentLoaded\n\n```\nonWebNavigationDOMContentLoaded(callback: (details: chrome.webNavigation.WebNavigationFramedCallbackDetails) =\u003e void, filters?: chrome.webNavigation.WebNavigationEventFilter): () =\u003e void\n```\n\nAdds a listener that is called when the page's DOM is fully constructed.\n\n\u003ca name=\"onWebNavigationErrorOccurred\"\u003e\u003c/a\u003e\n\n### onWebNavigationErrorOccurred\n\n```\nonWebNavigationErrorOccurred(callback: (details: chrome.webNavigation.WebNavigationFramedErrorCallbackDetails) =\u003e void, filters?: chrome.webNavigation.WebNavigationEventFilter): () =\u003e void\n```\n\nAdds a listener that is called when an error occurs and a navigation is aborted.\n\n\u003ca name=\"onWebNavigationHistoryStateUpdated\"\u003e\u003c/a\u003e\n\n### onWebNavigationHistoryStateUpdated\n\n```\nonWebNavigationHistoryStateUpdated(callback: (details: chrome.webNavigation.WebNavigationTransitionCallbackDetails) =\u003e void, filters?: chrome.webNavigation.WebNavigationEventFilter): () =\u003e void\n```\n\nAdds a listener that is called when a frame's history is updated to a new URL.\n\n\u003ca name=\"onWebNavigationReferenceFragmentUpdated\"\u003e\u003c/a\u003e\n\n### onWebNavigationReferenceFragmentUpdated\n\n```\nonWebNavigationReferenceFragmentUpdated(callback: (details: chrome.webNavigation.WebNavigationTransitionCallbackDetails) =\u003e void, filters?: chrome.webNavigation.WebNavigationEventFilter): () =\u003e void\n```\n\nAdds a listener that is called when the reference fragment of a frame is updated.\n\n\u003ca name=\"onWebNavigationTabReplaced\"\u003e\u003c/a\u003e\n\n### onWebNavigationTabReplaced\n\n```\nonWebNavigationTabReplaced(callback: (details: chrome.webNavigation.WebNavigationReplacementCallbackDetails) =\u003e void): () =\u003e void\n```\n\nAdds a listener that is called when a tab is replaced by another tab.\n\n\u003ca name=\"webrequest\"\u003e\u003c/a\u003e\n\n## webRequest\n\n**Documentation:** [Chrome WebRequest API](https://developer.chrome.com/docs/extensions/reference/webRequest)\n\nA promise-based wrapper for the Chrome `webRequest` API, providing methods to observe and modify network requests through various lifecycle events.\n\n### Methods\n\n- [handlerWebRequestBehaviorChanged](#handlerWebRequestBehaviorChanged)\n\n### Events\n\n- [onWebRequestAuthRequired](#onWebRequestAuthRequired)\n- [onWebRequestBeforeRedirect](#onWebRequestBeforeRedirect)\n- [onWebRequestBeforeRequest](#onWebRequestBeforeRequest)\n- [onWebRequestBeforeSendHeaders](#onWebRequestBeforeSendHeaders)\n- [onWebRequestSendHeaders](#onWebRequestSendHeaders)\n- [onWebRequestHeadersReceived](#onWebRequestHeadersReceived)\n- [onWebRequestResponseStarted](#onWebRequestResponseStarted)\n- [onWebRequestCompleted](#onWebRequestCompleted)\n- [onWebRequestErrorOccurred](#onWebRequestErrorOccurred)\n\n\u003ca name=\"handlerWebRequestBehaviorChanged\"\u003e\u003c/a\u003e\n\n### handlerWebRequestBehaviorChanged\n\n```\nhandlerWebRequestBehaviorChanged(): Promise\u003cvoid\u003e\n```\n\nNotifies the browser that the extension's webRequest handling logic (filters or listeners) has changed, prompting the browser to update its internal event routing.\n\n\u003ca name=\"onWebRequestAuthRequired\"\u003e\u003c/a\u003e\n\n### onWebRequestAuthRequired\n\n```\nonWebRequestAuthRequired(callback: (details: chrome.webRequest.OnAuthRequiredDetails, asyncCallback?: (response: chrome.webRequest.BlockingResponse) =\u003e void) =\u003e chrome.webRequest.BlockingResponse | void, filter: chrome.webRequest.RequestFilter, extraInfoSpec?: string[]): () =\u003e void\n```\n\nAdds a listener for authentication challenges. You can provide credentials, cancel the request, or take no action. Returns a function to remove the listener.\n\n\u003ca name=\"onWebRequestBeforeRedirect\"\u003e\u003c/a\u003e\n\n### onWebRequestBeforeRedirect\n\n```\nonWebRequestBeforeRedirect(callback: (details: chrome.webRequest.OnBeforeRedirectDetails) =\u003e void, filter: chrome.webRequest.RequestFilter, extraInfoSpec?: string[]): () =\u003e void\n```\n\nAdds a listener fired before a server-initiated redirect occurs. Returns a function to remove the listener.\n\n\u003ca name=\"onWebRequestBeforeRequest\"\u003e\u003c/a\u003e\n\n### onWebRequestBeforeRequest\n\n```\nonWebRequestBeforeRequest(callback: (details: chrome.webRequest.OnBeforeRequestDetails) =\u003e chrome.webRequest.BlockingResponse | void, filter: chrome.webRequest.RequestFilter, extraInfoSpec?: string[]): () =\u003e void\n```\n\nAdds a listener fired before a request is made. Can cancel or redirect the request by returning a BlockingResponse. Returns a function to remove the listener.\n\n\u003ca name=\"onWebRequestBeforeSendHeaders\"\u003e\u003c/a\u003e\n\n### onWebRequestBeforeSendHeaders\n\n```\nonWebRequestBeforeSendHeaders(callback: (details: chrome.webRequest.OnBeforeSendHeadersDetails) =\u003e chrome.webRequest.BlockingResponse | void, filter: chrome.webRequest.RequestFilter, extraInfoSpec?: string[]): () =\u003e void\n```\n\nAdds a listener fired before HTTP request headers are sent. Can modify or cancel the request headers. Returns a function to remove the listener.\n\n\u003ca name=\"onWebRequestSendHeaders\"\u003e\u003c/a\u003e\n\n### onWebRequestSendHeaders\n\n```\nonWebRequestSendHeaders(callback: (details: chrome.webRequest.OnSendHeadersDetails) =\u003e void, filter: chrome.webRequest.RequestFilter, extraInfoSpec?: string[]): () =\u003e void\n```\n\nAdds a listener fired after HTTP request headers are sent. Returns a function to remove the listener.\n\n\u003ca name=\"onWebRequestHeadersReceived\"\u003e\u003c/a\u003e\n\n### onWebRequestHeadersReceived\n\n```\nonWebRequestHeadersReceived(callback: (details: chrome.webRequest.OnHeadersReceivedDetails) =\u003e chrome.webRequest.BlockingResponse | void, filter: chrome.webRequest.RequestFilter, extraInfoSpec?: string[]): () =\u003e void\n```\n\nAdds a listener fired when HTTP response headers are received. Can modify response headers or cancel the request. Returns a function to remove the listener.\n\n\u003ca name=\"onWebRequestResponseStarted\"\u003e\u003c/a\u003e\n\n### onWebRequestResponseStarted\n\n```\nonWebRequestResponseStarted(callback: (details: chrome.webRequest.OnResponseStartedDetails) =\u003e void, filter: chrome.webRequest.RequestFilter, extraInfoSpec?: string[]): () =\u003e void\n```\n\nAdds a listener fired when the first byte of the response body is received. Returns a function to remove the listener.\n\n\u003ca name=\"onWebRequestCompleted\"\u003e\u003c/a\u003e\n\n### onWebRequestCompleted\n\n```\nonWebRequestCompleted(callback: (details: chrome.webRequest.OnCompletedDetails) =\u003e void, filter: chrome.webRequest.RequestFilter, extraInfoSpec?: string[]): () =\u003e void\n```\n\nAdds a listener fired when a request is completed successfully. Returns a function to remove the listener.\n\n\u003ca name=\"onWebRequestErrorOccurred\"\u003e\u003c/a\u003e\n\n### onWebRequestErrorOccurred\n\n```\nonWebRequestErrorOccurred(callback: (details: chrome.webRequest.OnErrorOccurredDetails) =\u003e void, filter: chrome.webRequest.RequestFilter, extraInfoSpec?: string[]): () =\u003e void\n```\n\nAdds a listener fired when a request encounters an error and is aborted. Returns a function to remove the listener.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddonbone%2Fbrowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddonbone%2Fbrowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddonbone%2Fbrowser/lists"}