Skip to content

domain/tabs/tab-service

Defined in: app/src/domain/tabs/tab-service.ts:96

Owns the tabs of one window: their order, the active tab and recently closed tabs. A window always keeps at least one tab.

new TabService(views, blankUrl, onLastClosed?): TabService

Defined in: app/src/domain/tabs/tab-service.ts:117

TabViewPort

Creates and controls the web views.

string

URL of a new, empty tab.

() => void

Called instead of opening a new tab when the last tab closes.

TabService

readonly onDidChange: Event<void>

Defined in: app/src/domain/tabs/tab-service.ts:110

Fires after any tab or the active tab changed.

get active(): Tab | undefined

Defined in: app/src/domain/tabs/tab-service.ts:129

The active tab, if any.

Tab | undefined

get all(): readonly Tab[]

Defined in: app/src/domain/tabs/tab-service.ts:124

All tabs in display order.

readonly Tab[]

activate(id): void

Defined in: app/src/domain/tabs/tab-service.ts:170

Makes a tab the active tab.

string

The tab.

void

close(id): void

Defined in: app/src/domain/tabs/tab-service.ts:185

Closes a tab. Closing the active tab activates its right neighbour, or the left one at the end. Closing the last tab opens a blank tab.

string

The tab.

void

dispose(): void

Defined in: app/src/domain/tabs/tab-service.ts:263

Destroys every view and removes listeners.

void

Disposable.dispose

navigate(id, url): void

Defined in: app/src/domain/tabs/tab-service.ts:227

Loads a URL in a tab.

string

The tab.

string

The URL.

void

open(url?, options?): string

Defined in: app/src/domain/tabs/tab-service.ts:140

Opens a tab after the active one, or in the background after the tabs opened there before it, as Chromium does.

string = ...

URL to load; defaults to the blank page.

OpenTabOptions = {}

Whether to activate the tab.

string

The new tab’s id.

reopenClosed(): string | undefined

Defined in: app/src/domain/tabs/tab-service.ts:217

Reopens the most recently closed tab.

string | undefined

The reopened tab’s id, or undefined if nothing was closed.

run(id, action): void

Defined in: app/src/domain/tabs/tab-service.ts:237

Runs a history or loading action in a tab.

string

The tab.

"back" | "forward" | "reload" | "stop"

What to do.

void

update(id, update): void

Defined in: app/src/domain/tabs/tab-service.ts:247

Applies state reported by the web view, such as a new title.

string

The tab.

TabUpdate

Changed fields.

void

Defined in: app/src/domain/tabs/tab-service.ts:61

Options for TabService.open.

readonly optional activate?: boolean

Defined in: app/src/domain/tabs/tab-service.ts:67

Whether the new tab becomes the active tab. Defaults to true. Tabs opened in the background line up after the active tab in the order they open, until another tab becomes active, so links opened one after another keep their order.

readonly optional lazy?: boolean

Defined in: app/src/domain/tabs/tab-service.ts:69

Creates the tab’s view only when the tab is shown.

readonly optional title?: string

Defined in: app/src/domain/tabs/tab-service.ts:71

Title to show until the page reports its own, such as the title of a restored tab.


Defined in: app/src/domain/tabs/tab-service.ts:22

The state of one tab.

readonly blocked: number

Defined in: app/src/domain/tabs/tab-service.ts:30

Requests that the content blocker blocked on the current page.

readonly canGoBack: boolean

Defined in: app/src/domain/tabs/tab-service.ts:27

readonly canGoForward: boolean

Defined in: app/src/domain/tabs/tab-service.ts:28

readonly id: string

Defined in: app/src/domain/tabs/tab-service.ts:23

readonly loading: boolean

Defined in: app/src/domain/tabs/tab-service.ts:26

readonly problem: TabProblem | null

Defined in: app/src/domain/tabs/tab-service.ts:32

Why the tab shows no page, or null when it shows one.

readonly title: string

Defined in: app/src/domain/tabs/tab-service.ts:25

readonly url: string

Defined in: app/src/domain/tabs/tab-service.ts:24

readonly zoom: number

Defined in: app/src/domain/tabs/tab-service.ts:34

The zoom factor of the page, 1 for 100 %.


Defined in: app/src/domain/tabs/tab-service.ts:14

Why a tab shows no page: the page could not be loaded (error), the certificate of its site is not trusted (certificate), or the process that showed it is gone (crashed). code is Chromium’s name for the cause, such as ERR_CONNECTION_REFUSED, url the address of the page, and proceed whether the user may continue to it after a warning.

readonly code: string

Defined in: app/src/domain/tabs/tab-service.ts:16

readonly kind: "error" | "certificate" | "crashed"

Defined in: app/src/domain/tabs/tab-service.ts:15

readonly proceed: boolean

Defined in: app/src/domain/tabs/tab-service.ts:18

readonly url: string

Defined in: app/src/domain/tabs/tab-service.ts:17


Defined in: app/src/domain/tabs/tab-service.ts:44

Port to the web views of a window. The platform layer implements it with one WebContentsView per tab; tests use a fake.

create(id, url, lazy?): void

Defined in: app/src/domain/tabs/tab-service.ts:49

Creates the view of a tab and loads the URL. A lazy tab gets its view only when it is shown, so restored tabs cost nothing until they are used.

string

string

boolean

void

destroy(id): void

Defined in: app/src/domain/tabs/tab-service.ts:53

Destroys the view of a tab.

string

void

load(id, url): void

Defined in: app/src/domain/tabs/tab-service.ts:55

Loads a URL in a tab.

string

string

void

run(id, action): void

Defined in: app/src/domain/tabs/tab-service.ts:57

Runs a history or loading action.

string

"back" | "forward" | "reload" | "stop"

void

show(id): void

Defined in: app/src/domain/tabs/tab-service.ts:51

Shows the view of a tab and hides the previously shown one.

string

void

TabId = string

Defined in: app/src/domain/tabs/tab-service.ts:6

Identifier of a tab, such as t1a.


TabUpdate = Partial<Omit<Tab, "id">>

Defined in: app/src/domain/tabs/tab-service.ts:38

Fields of a tab that the web view reports.

const TabServiceToken: Token<TabService>

Defined in: app/src/domain/tabs/tab-service.ts:75

Token for the TabService of a window.