Host · class

BrowserLifecycle

Explained in Display and the host.

class BrowserLifecycle implements Lifecycle
import { BrowserLifecycle } from '@driftengine/core';

Methods

onFocusChange

onFocusChange(handler: (focused: boolean) => void): () => void
ParameterTypeDescription
handler(focused: boolean) => void

onQuitRequest

onQuitRequest(handler: () => void): () => void

A browser is never asked to quit, so this handler is never called here.

ParameterTypeDescription
handler() => void
More

The unsubscribe is real rather than the handler being rejected: a consumer registers the same handler on both platforms and must be able to drop it on both, and code that has to ask which platform it is on has lost the point of the seam.

requestQuit

requestQuit(): void

Signatures

canQuit = falsereadonly

readonly canQuit = false

False: no page may close the tab it is in. An exit button here is a button that lies.