Skip to main content

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.

PortWhat it does for you
RuntimePortSend/receive typed messages across contexts, react to install & update lifecycle events, and reload the extension — no chrome.runtime needed.
I18nPortResolve localized UI strings and detect the active browser language from one injectable service.
ExtensionPortTurn 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.

PortWhat it does for you
ActionPortDrive the toolbar button: set badge text, swap icons, open the popup programmatically.
AlarmsPortSchedule one-off and repeating background work that survives service-worker suspension.
BookmarksPortRead, create, search, and remove bookmark tree nodes.
BrowsingDataPortClear caches, cookies, and history in a single call.
CommandsPortRegister keyboard shortcuts and respond when users trigger them.
CookiesPortRead, write, and observe cookies across their full lifecycle.
DeclarativeNetRequestPortAdd and update MV3 network-interception rules declaratively.
DownloadsPortStart downloads and manage the download queue.
HistoryPortSearch, add to, and delete browsing-history entries.
IdentityPortRun OAuth 2.0 sign-in flows and read the signed-in user profile.
IdlePortDetect when the system goes idle, active, or locked.
ManagementPortInspect and manage other installed extensions and their lifecycle.
MenusPortCreate context-menu items and handle their click events.
NotificationsPortShow OS-level notifications from the background.
PermissionsPortRequest and revoke optional permissions at runtime.
ScriptingPortInject scripts and styles into tabs at runtime (MV3).
StoragePortRead/write any browser storage area (local, sync, session) through one API.
TabGroupsPortQuery and manage tab groups.
TabsPortQuery tabs, message a specific tab, and broadcast to many.
UserScriptsPortRegister isolated-world user scripts.
WebNavigationPortObserve every stage of a page navigation lifecycle.
WebRequestPortObserve and intercept network requests.

Deprecated background ports

PortReplacement
BrowserActionPortUse ActionPort
PageActionPortUse ActionPort

UI Ports

Available in managed UI surfaces (popup, options, DevTools panels).

PortWhat it does for you
DevtoolsPortCreate custom DevTools panels and sidebar panes.

Content Ports

Available in content scripts.

PortWhat it does for you
ClipboardPortRead 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.