Architecture Overview
Flow Browser is built on Electron and uses a modular controller architecture:- Windows Controller: Manages browser windows and UI
- Profiles Controller: Handles user profiles and sessions
- Tabs Controller: Manages tab lifecycle, layout, and state
- Spaces Controller: Organizes tabs into workspaces
Core Controllers
browserWindowsController
Manages browser window creation and lifecycle.Methods
Creates a new browser windowParameters:
type:'normal' | 'popup'- Window typeoptions: Window creation options (width, height, x, y)
Creates a window without waiting for Electron to be ready. Only use if Electron is already initialized.
Returns all browser windows
Returns the currently focused window
Retrieves a window by its ID
Finds a window from its WebContents instance
Destroys all browser windowsParameters:
force: Whether to force destroy (default: false)
loadedProfilesController
Manages loaded user profiles and their sessions.Methods
Loads a profile and its session. Returns true if successful.
Retrieves a loaded profile by ID
Returns all loaded profiles
Unloads a profile and destroys its tabs
tabsController
Manages tab creation, lifecycle, and state.Methods
Creates a new tab. If parameters are omitted, uses focused window and last used space.Parameters:
windowId: Window to create tab in (optional)profileId: Profile for the tab (optional)spaceId: Space to assign tab to (optional)webContentsViewOptions: Electron WebContentsView options (optional)tabCreationOptions: Additional tab options (optional)
Retrieves a tab by its ID
Finds a tab from its WebContents
Sets the active tab for its window and space
Returns all tabs in a window
Returns all tabs in a profile
Events
Controllers emit TypedEventEmitter events that you can listen to:Example: Creating a Complete Browser Session
Related
Tab
Learn about the Tab class
Window
Learn about BrowserWindow
Profile
Learn about LoadedProfile