Class DefaultWindowService

Hierarchy (view full)

Implements

Constructors

Properties

allowVetoes: boolean = true
corePreferences: CorePreferences
frontendApplication: FrontendApplication
onUnloadEmitter: Emitter<void> = ...

Accessors

Methods

  • Called when the window is about to unload its resources. At this point, the document is still visible and the BeforeUnloadEvent event will be canceled if the return value of this method is false.

    In Electron, handleCloseRequestEvent is is run instead.

    Parameters

    • event: BeforeUnloadEvent

    Returns string | void

  • Checks FrontendApplicationContribution#willStop for impediments to shutdown and runs any actions returned. Can be used safely in browser and Electron when triggering reload or shutdown programmatically. Should only be called before a shutdown - if this returns true, FrontendApplicationContribution#willStop will not be called again in the current session. I.e. if this return true, the shutdown should proceed without further condition.

    Parameters

    Returns Promise<boolean>

  • Notify the browser that we do not want to unload.

    Notes:

    • Shows a confirmation popup in browsers.
    • Prevents the window from closing without confirmation in electron.

    Parameters

    • event: BeforeUnloadEvent

      The beforeunload event

    Returns string | void

  • Will prevent subsequent checks of FrontendApplicationContribution#willStop. Should only be used after requesting user confirmation.

    This is primarily intended programmatic restarts due to e.g. change of display language. It allows for a single confirmation of intent, rather than one warning and then several warnings from other contributions.

    Returns void