Skip to content

Window Management

mattreaganmozilla edited this page Sep 22, 2025 · 6 revisions

The Firefox iOS client supports multiple windows on iPad devices. This feature brought with it several key changes to the app architecture which will be discussed in further detail below.

Window UUIDs

The management of UUIDs is a critical component of Firefox iOS, since each window contains its own unique set of tabs and manages its own set of events and notifications. For these reasons, a window must be uniquely identifiable by its UUID. The diagram below provides a simplified overview of how UUIDs are established whenever a new window is created (or a previously used window is restored).

Screenshot 2025-09-22 at 8 52 22 AM

Our UISceneDelegate entry point is the topmost hook that iOS provides to signal to the client that a new window (scene) is being connected in the client. This triggers the creation of the scene's SceneCoordinator, which in turn calls into the ubiquitous WindowManager to "reserve" a UUID for the window that is being created.

This process is referred to as "UUID reservation" because the process of configuring and launching a new window is not synchronous, and actually takes place over several iterations of the main thread run loop. The implications of this are important, since multiple windows can potentially be restored simultaneously, before the first window is actually finished.

The WindowManager, upon receiving a request for a new window UUID, utilizes the TabDataStore to check for on-disk window data. The associated UUIDs for these windows, along with ordering preferences stored in UserDefaults, are used to allow multiple windows (and their tabs) to be closed and re-opened on iPad in the correct order.

UUID Injection

Once a window that is being created has "reserved" its UUID, this is stored initially on the SceneCoordinator, and then once the browser is launched, the critical / topmost sub-components are created and this UUID is injected into those. These key components include:

  • The window's unique TabManager instance
  • The BrowserCoordinator
  • The BrowserViewController instance

From here, the UUID is further injected down the object dependency graph to allow any component to identify which window it belongs to in a multi-window environment.

Clone this wiki locally