Ports Catalog
HexaJS ships browser-agnostic ports covering the entire browser-API surface — one Promise-based, injectable API that works identically across Chrome, Firefox, Safari, Edge, Opera, and Brave. The CLI build swaps in the correct platform implementation automatically via __HEXA_PLATFORM__ tree-shaking.
Every port listed below is ready to inject into your controllers, handlers, and services. Click a port name for full method signatures and usage examples.
General Ports
Available in any runtime context — background, UI, or content.
| Port | What it does for you |
|---|---|
| RuntimePort | Send/receive typed messages across contexts, react to install & update lifecycle events, and reload the extension — no chrome.runtime needed. |
| I18nPort | Resolve localized UI strings and detect the active browser language from one injectable service. |
| ExtensionPort | Turn bundled asset paths into extension URLs and reach other extension views without hardcoding chrome-extension://. |
Background Ports
Available only in the extension's service worker / background page context.
| Port | What it does for you |
|---|---|
| ActionPort | Drive the toolbar button: set badge text, swap icons, open the popup programmatically. |
| AlarmsPort | Schedule one-off and repeating background work that survives service-worker suspension. |
| BookmarksPort | Read, create, search, and remove bookmark tree nodes. |
| BrowsingDataPort | Clear caches, cookies, and history in a single call. |
| CommandsPort | Register keyboard shortcuts and respond when users trigger them. |
| CookiesPort | Read, write, and observe cookies across their full lifecycle. |
| DeclarativeNetRequestPort | Add and update MV3 network-interception rules declaratively. |
| DownloadsPort | Start downloads and manage the download queue. |
| HistoryPort | Search, add to, and delete browsing-history entries. |
| IdentityPort | Run OAuth 2.0 sign-in flows and read the signed-in user profile. |
| IdlePort | Detect when the system goes idle, active, or locked. |
| ManagementPort | Inspect and manage other installed extensions and their lifecycle. |
| MenusPort | Create context-menu items and handle their click events. |
| NotificationsPort | Show OS-level notifications from the background. |
| PermissionsPort | Request and revoke optional permissions at runtime. |
| ScriptingPort | Inject scripts and styles into tabs at runtime (MV3). |
| StoragePort | Read/write any browser storage area (local, sync, session) through one API. |
| TabGroupsPort | Query and manage tab groups. |
| TabsPort | Query tabs, message a specific tab, and broadcast to many. |
| UserScriptsPort | Register isolated-world user scripts. |
| WebNavigationPort | Observe every stage of a page navigation lifecycle. |
| WebRequestPort | Observe and intercept network requests. |
Deprecated background ports
| Port | Replacement |
|---|---|
| BrowserActionPort | Use ActionPort |
| PageActionPort | Use ActionPort |
UI Ports
Available in managed UI surfaces (popup, options, DevTools panels).
| Port | What it does for you |
|---|---|
| DevtoolsPort | Create custom DevTools panels and sidebar panes. |
Content Ports
Available in content scripts.
| Port | What it does for you |
|---|---|
| ClipboardPort | Read from and write to the clipboard from content scripts, with a browser-safe write fallback. |
Need something not listed?
If the browser API you need isn't covered by a built-in port, you can create your own. See Custom Ports for a step-by-step guide to building platform-aware abstractions.