Overview
The Browser IPC namespace provides APIs for managing browser profiles, tabs, navigation, and page content. These APIs are available through thewindow.flow.browser, window.flow.tabs, and window.flow.navigation objects.
Browser API
Thewindow.flow.browser API manages browser profiles and windows.
Source Files
- Interface:
src/shared/flow/interfaces/browser/browser.ts - Handler:
src/main/ipc/browser/browser.ts - Preload:
src/preload/index.ts:411-421
Methods
Loads a profile, initializing its session and making it available for use.
- Usage
- Handler
The ID of the profile to load
Unloads a profile, cleaning up its session and resources.
- Usage
- Handler
The ID of the profile to unload
Creates a new browser window.
- Usage
- Handler
Tabs API
Thewindow.flow.tabs API provides comprehensive tab management capabilities.
Source Files
- Interface:
src/shared/flow/interfaces/browser/tabs.ts - Handler:
src/main/ipc/browser/tabs.ts - Preload:
src/preload/index.ts:423-483
Data Methods
Retrieves all tab data for the current window, including tabs, tab groups, focused tabs, and active tabs.
- Usage
- Handler
Array of tab data objects containing id, title, url, favicon, loading state, etc.
Array of tab group data objects
Map of space ID to focused tab ID
Map of space ID to active tab ID(s)
Subscribes to full tab data refresh events. Called when structural changes occur (tabs added/removed, active tab changed, etc.).
- Usage
- React Hook
This listener receives full
WindowTabsData refreshes. For more efficient content-only updates (title, url, loading state), use onTabsContentUpdated instead.Subscribes to lightweight content-only tab updates. Receives only the tabs whose content (title, url, isLoading, etc.) changed, without a full refresh.
- Usage
- React Hook
The IPC layer automatically debounces updates (80ms) and batches content changes to reduce overhead. If a structural change occurs during the debounce window, it absorbs pending content changes.
Tab Operations
Switches to (activates) the specified tab.
Closes the specified tab.
Moves a tab to a new position within its current space.
The handler automatically normalizes positions after reordering to prevent drift. If the tab is in a group, all group members are moved together.
Moves a tab to a different space, optionally at a specific position.
Moves multiple tabs to a new space in one operation.
Tab Context Menu
Displays the native context menu for a tab.
- Usage
- Implementation
Tab State
Sets the audio muted state of a tab.
Disables Picture-in-Picture mode for a tab.
Recently Closed Tabs
Retrieves all recently closed tabs, sorted by most recently closed first.
Restores a recently closed tab by its unique ID.
- Usage
- Implementation
Clears the list of recently closed tabs.
Navigation API
Thewindow.flow.navigation API handles page navigation within tabs.
Source Files
- Interface:
src/shared/flow/interfaces/browser/navigation.ts - Handler:
src/main/ipc/browser/navigation.ts - Preload:
src/preload/index.ts:495-512
Methods
Navigates to a specific URL. If no tab ID is provided, navigates the focused tab.
- Usage
- Handler
Stops loading the specified tab.
Reloads the specified tab.
Gets the navigation status of a tab, including navigation history and back/forward capabilities.
- Usage
- Handler
Array of navigation entries, where index 0 is the earliest visited page
Index of the currently active navigation entry
Whether the tab can navigate back
Whether the tab can navigate forward
Navigates to a specific entry in the tab’s navigation history.
Complete Example
Here’s a complete React component that uses the Browser IPC APIs:Related APIs
App IPC
Application info and clipboard APIs
Window IPC
Window management and controls
IPC Overview
Learn about Flow’s IPC architecture