proton

    MoonBit bindings for the Proton native desktop runtime.

    proton
    gui
    web
    desktop-app
    Download zip
    Version
    0.2.10
    License
    Apache-2.0
    Last updated
    2 hours ago
    Downloads
    8K

    #moonbit-community/proton

    MoonBit facade for building Proton desktop applications on the native runtime. This package is the public app surface: windows, entries, commands, events, and lifecycle hooks are all configured from MoonBit code. For the full development workflow — scaffolding, CEF runtime setup, dev mode, and packaging — see the repository README and the proton_cli tool.

    #Quick example

    async fn main {
    @proton.html("Hello", "<h1>Hello</h1>")
    .identifier("dev.proton.hello")
    .run_or_abort()
    }

    main is async because Proton hands its own event loop to moonbitlang/async during process initialization; from then on every line of MoonBit runs on the main thread and only async's waiting half moves to a thread of its own. Nothing has to be installed by hand, but the package must import moonbitlang/async for async fn main to be available at all. @proton.html accepts optional width?, height?, debug?, and resizable? arguments.

    Every application requires a stable reverse-DNS identity. Managed projects use .load_config() to load it from proton.project.json during development and from packaged metadata after distribution. Applications without project metadata use .identifier(...) as shown above. These sources are mutually exclusive, and an explicit identity must match any packaged metadata present at runtime.

    #Application metadata and paths

    Managed applications expose the package product_name and version through App::name and App::version. Development runs read proton.project.json; packaged runs read the sanitized proton-package.json generated by proton_cli package. Missing package metadata is reported explicitly instead of falling back to the window title or Proton library version.

    @proton.app_path() returns the application resource root and @proton.is_packaged() distinguishes packaged execution. App::path accepts a typed AppPathKind for home, application data, user data, browser session data, temporary files, the executable/module, logs, and configured desktop, documents, downloads, music, pictures, and videos directories. Assets is available on Windows and Linux, and Recent is available on Windows. Persistent application paths use the reverse-DNS identifier, so changing a display name does not move user state. Use App::session_partition with .single_instance() to place the browser profile in an isolated sessionData/<partition> directory. Cookies, cache, IndexedDB, and other Chromium profile state are separated between partitions. Partition names are limited to letters, digits, ., -, and _. SessionHandle::clear_auth_cache clears Chromium's cached HTTP authentication credentials without clearing cookies or the HTTP cache. SessionHandle::clear_certificate_exceptions clears remembered certificate exception decisions for the same request context. SessionHandle::close_all_connections closes active and idle Chromium network connections for the session without clearing cookies or cache data.

    Use App::on_permission_request to apply one policy to certificate and media permission requests. It takes precedence over the specialized handlers; when no handler is configured, Proton denies both request types by default.

    Use App::proxy to configure a startup-wide Chromium proxy. Proton passes the server and optional bypass list to CEF before startup; changing proxy settings while the application is running is not supported.

    App::set_path overrides any supported standard path before startup and requires an existing absolute path. App::set_app_logs_path accepts an absolute directory that Proton creates during startup; omitting the path selects Electron's default logs location. UserData overrides feed the default SessionData path, while an explicit SessionData override becomes the CEF browser profile location for single-instance applications.

    #Protocol and process control

    Declare application URL schemes with App::url_scheme. A running ApplicationContext can then set, remove, or query the current application as the default handler with set_as_default_protocol_client, remove_default_protocol_client, and is_default_protocol_client. macOS requires the packaged CFBundleURLTypes declaration; Linux requires the generated desktop entry to be installed. Electron does not expose protocol removal on Linux, so Proton returns false there as well.

    ApplicationContext::relaunch schedules a replacement process without stopping the current one. With no options it preserves the current command line; RelaunchOptions can replace the executable or arguments. Call quit for orderly shutdown or exit for immediate Electron-style termination that skips close interception and lifecycle cleanup. Scheduled relaunches are started after orderly cleanup or immediately before exit terminates the process.

    #Entry points

    • @proton.html(title, html, ...) — inline HTML document.
    • @proton.url(title, url, ...) — a remote or local URL.
    • @proton.file(title, path, ...) — an HTML file on disk.
    • @proton.asset(title, path, ...) — an HTML asset shipped with the app.

    Configure Chromium network policy with App::web_request_cancel_prefix, App::web_request_redirect_prefix, and App::web_request_header_prefix. Subscribe with App::on_browser_event to observe BrowserEvent::ResourceRequested before a request is sent, ResourceResponse when headers arrive, and ResourceCompleted when it finishes. The request event includes its URL, HTTP method, and whether the configured synchronous policy will cancel it. A non-zero completion status represents an error; request callbacks are observational and do not expose mutable CEF objects across the native boundary.

    #Native images

    @proton.native_image() creates an Electron-style image container. Add PNG, JPEG, or raw RGBA bitmap representations with an explicit scale factor, query its logical size, and export the closest representation with to_png, to_jpeg, or to_bitmap. Call destroy when the image is no longer needed; repeated destruction is safe.

    #Commands and events

    Register typed commands on the app builder:

    @proton.html("Commands", html)
    .identifier("dev.proton.commands")
    .commands(fn(registrar) raise { registrar.bind(ping_command, ping) })
    .run_or_abort()

    Application commands target the primary configured entry by default. Pass targets to .commands(...) when a different renderer needs them. Extension packages expose typed values consumed by .capability(...).

    @proton.CommandRegistrar binds contract command descriptors to async handlers; each handler receives a @proton.CommandContext and the decoded request payload. The backend emits events to the requesting page with CommandContext::emit_to_caller(event, payload). JavaScript invokes commands and subscribes to events through the bridge installed on window: commands are called by their contract operation name through core.invokeOp, and backend events arrive on the events channel. For a contract with namespace app:

    const reply = await window.__MoonBit__.core.invokeOp("ext:app/ping", { name: "proton", }); window.__MoonBit__.events.on("app.tick", (event) => console.log(event.payload));

    Extensions built on moonbit-community/proton_ext additionally install namespaced proxies such as window.__MoonBit__.ticker.start(...).

    #Windows

    Add secondary windows to the app builder:

    @proton.html("Main", main_html)
    .add_window(
    "settings",
    "Settings",
    @proton.AppEntry::Html(settings_html),
    width=420,
    height=320,
    )

    The window id "main" is reserved for the primary window. By default, the process exits when all windows have closed. Use .last_window_closed_policy(@proton.LastWindowClosedPolicy::KeepRunning) when the application should remain available for Dock, protocol, document, or tray activation after its last window closes.

    Live window handles can change native frame behavior after creation. In particular, WindowHandle::set_movable(false) blocks manual movement on macOS and Windows while preserving programmatic placement; Linux follows Electron's successful no-op behavior. WindowHandle::set_opacity adjusts the complete native window, including its frame and renderer, with values clamped to 0.0..1.0. WindowHandle::set_skip_taskbar controls the Windows taskbar tab while preserving Electron's no-op behavior on macOS and Linux. WindowHandle::set_aspect_ratio constrains interactive resizing and accepts 0.0 to clear the constraint; programmatic set_size calls remain unconstrained, matching Electron. WindowHandle::set_content_size adjusts the renderer area while accounting for the native frame. content_size reads that area back in logical pixels. Window frame sizes, content sizes, and minimum/maximum size constraints use logical pixels on Windows too. Proton converts these lengths using the window's current DPI. Initial unconstrained windows are fitted to their monitor's work area before they are shown; explicit fixed/minimum size hints take precedence. set_menu replaces or clears the runtime menu, set_icon loads a native icon from a file path, and set_parent establishes a native owner/transient or modal relationship. set_window_button_visibility controls standard title-bar buttons on macOS and is a successful no-op on other platforms. Web contents views expose independent set_zoom_percent and zoom_percent controls for their own browser.

    Window state changes are delivered to .on_window_event(...) as a full StateChanged snapshot plus lifecycle and transition events such as Closed, ReadyToShow, Moved, Resized, Show, Hide, Focus, Blur, Minimize, Restore, Maximize, Unmaximize, EnterFullScreen, and LeaveFullScreen. The first native snapshot only emits StateChanged, because no previous state exists for transition detection.

    Browser loading events include DidStartLoading and DidFinishLoad, derived from successive native loading snapshots; LoadingChanged remains available for consumers that prefer the boolean form.

    Use App::web_request_cancel_prefix to declare synchronous request blocking rules before startup. Matching is case-sensitive, uses URL prefixes, and applies to every window and web contents view created by the application. App::web_request_redirect_prefix provides the corresponding fixed-target rewrite for matching requests; cancellation takes precedence when both rules match. Use App::web_request_header_prefix to override a named request header for matching URLs before the request is sent.

    Browser event handlers also receive ResourceResponse with the response URL and HTTP status, followed by ResourceCompleted with the completion status and received byte count. These are observations only and do not block the IO thread.

    Web contents views expose the same loading lifecycle events through ViewEvent::DidStartLoading and ViewEvent::DidFinishLoad; their LoadingChanged event remains available as the boolean form. If a view's renderer terminates, handlers receive ViewEvent::RendererProcessTerminated with the page URL, CEF termination status, CEF error code, and diagnostic detail. Proton reports this event through the normal wake-driven event queue and does not automatically reload the view; applications may explicitly call ViewHandle::reload.

    #Taskbar status

    WindowHandle::set_progress_bar reports window progress on the platform's application surface. A negative value clears the indicator, 0.0 through 1.0 is determinate, and a value above 1.0 is indeterminate. The optional mode mirrors Electron's mode option and selects an explicit state instead:

    window.set_progress_bar(0.4) // determinate
    window.set_progress_bar(0.4, mode=@proton.ProgressBarMode::Paused) // paused
    window.set_progress_bar(-1.0, mode=@proton.ProgressBarMode::Cleared) // cleared

    Windows shows the indicator on the taskbar button, where Normal, Indeterminate, Error, and Paused map to Electron's taskbar states and Cleared removes it. macOS shows it in the Dock as one application-level indicator, where the most recent window call wins and no mode applies. Linux has no implementation and raises WindowSessionError.

    WindowHandle::set_overlay_icon shows a badge in the bottom right corner of the Windows taskbar icon. The overlay is a NativeImage built through @proton.native_image() and None clears it:

    let overlay = @proton.native_image()
    overlay.add_png(png_bytes, 16, 16)
    window.set_overlay_icon(Some(overlay), "unread messages")
    window.set_overlay_icon(None, "")

    Windows scales the image to the 16x16 overlay area, keeps the aspect ratio, and clips it to a circle, matching Electron's rendering. Accessibility screen readers use the description.

    WindowHandle::set_thumbnail_tooltip sets the text shown while the pointer rests over the Windows taskbar thumbnail. The overlay icon and the thumbnail tooltip are Windows-only in Electron; Proton accepts those calls on macOS and Linux and does nothing, which keeps cross-platform application code free of platform checks. examples/78_taskbar_status is the manual review flow for all four APIs.

    #Taskbar thumbnail toolbar

    WindowHandle::set_thumbar_buttons replaces the buttons shown with the taskbar thumbnail. Each button carries the NativeImage it shows, an optional tooltip, its flags, and the id that a click reports:

    let previous = @proton.native_image()
    previous.add_png(previous_png, 16, 16)
    let applied = window.set_thumbar_buttons([
    @proton.ThumbarButton::{
    id: "previous",
    icon: previous,
    tooltip: "Previous",
    flags: [],
    },
    @proton.ThumbarButton::{
    id: "play",
    icon: play,
    tooltip: "Play or pause",
    flags: [@proton.ThumbarButtonFlag::NoBackground],
    },
    ])

    Electron's limits and flags apply: at most seven buttons, Disabled, DismissOnClick, NoBackground, Hidden, and NonInteractive as flags, and an empty array clears the buttons. Windows claims the button slots with the first successful call, so a later call can replace or hide buttons but cannot remove the toolbar, exactly as Electron documents.

    @proton.html("Player", player_html)
    .on_thumbar_button_click(fn(window, button_id) noraise {
    match button_id {
    "previous" => play_previous(window)
    "next" => play_next(window)
    _ => toggle_playback(window)
    }
    })
    .run_or_abort()

    set_thumbar_buttons returns whether the platform showed the buttons: Windows returns the taskbar result and macOS and Linux return false, the same result Electron reports for its Windows-only thumbnail toolbar. Electron attaches one callback per button; Proton reports the button id through App::on_thumbar_button_click instead, so rebuilding the toolbar cannot silently retarget a click.

    #Jump list

    set_jump_list replaces the application's custom Windows jump list, or removes it when the argument is None. It mirrors app.setJumpList, including the category kinds and the result values:

    let result = @proton.set_jump_list(Some([
    @proton.JumpListCategory::{
    kind: @proton.JumpListCategoryKind::Tasks,
    name: "",
    items: [
    @proton.JumpListItem::{
    kind: @proton.JumpListItemKind::Task,
    path: executable,
    arguments: "--play",
    title: "Play or pause",
    description: "Starts playback in a new instance",
    icon_path: executable,
    icon_index: 0,
    working_directory: "",
    },
    // A separator is only allowed in the Tasks category.
    @proton.JumpListItem::{
    kind: @proton.JumpListItemKind::Separator,
    path: "",
    arguments: "",
    title: "",
    description: "",
    icon_path: "",
    icon_index: 0,
    working_directory: "",
    },
    ],
    },
    @proton.JumpListCategory::{
    kind: @proton.JumpListCategoryKind::Custom,
    name: "Recent sessions",
    items: [...],
    },
    ])) catch {
    error => abort(error.message())
    }

    The result reports what Windows did. Ok means the list was applied; Error means one or more categories or items failed; InvalidSeparator means a separator appeared outside the Tasks category; FileTypeRegistrationError means a file link has no registered handler; and CustomCategoryAccessDenied means Windows blocked custom categories through its privacy setting or group policy. Unsupported is Proton's own result for macOS and Linux, where Electron leaves the API undefined.

    The list belongs to the application's AppUserModelID. An installed application registers that identity in its installer; without one Windows derives it from the executable path, which is the same identity the taskbar button uses. Users can remove items from custom categories, and Windows ignores any category that re-adds a removed item until the next successful call.

    #Logging

    Use tonyfettes/xlog@0.4.2 directly for application logs. Proton configures the global logger before native runtime creation. Packaged applications write to their platform log directory; direct launches and proton_cli dev use stderr. xlog initializes filtering from MOON_XLOG (default: Info). Proton preserves the global logger's level and category rules, including application overrides, and follows xlog's handling of invalid MOON_XLOG values. PROTON_LOG_OUTPUT selects file or stderr; file output requires packaged application metadata. Application categories should use app.*; proton.* is reserved for framework diagnostics. Logging is initialized once per process and remains active after App::run returns or raises, so application error handling continues writing to the same output. Subsequent runs preserve the current handler and filtering settings. Runtime failures are logged with their full diagnostics before displaying an error dialog.

    #Headless mode

    .headless() runs the app off-screen without creating a native window. Set PROTON_HEADLESS=1 to force headless mode for automated test runs.

    Native dialogs, menus, title bars, and other window-bound UI are unavailable in headless mode. In particular, open, save, and directory dialogs fail with an unsupported-operation error instead of displaying unparented system UI.

    #Accessibility

    Proton uses Chromium's accessibility tree for web content. Use semantic HTML, ARIA, keyboard navigation, and visible focus in the renderer; Proton does not maintain a second backend-owned node tree. Native menus, dialogs, and window controls use their platform toolkit's accessibility implementation.

    Accessibility is automatic by default. macOS follows VoiceOver, Switch Control, and accessibility clients that request an enhanced user interface. Windows enables accessibility when a screen reader is reported or an accessibility client queries the window. Linux keeps the tree enabled because GTK 3 has no reliable process-local activity signal. Headless mode also keeps the tree enabled for automation. To keep it enabled unconditionally in a windowed application, configure the app before startup:

    @proton.html("Accessible", "<main><h1>Hello</h1></main>")
    .identifier("dev.proton.accessible")
    .accessibility(@proton.AccessibilityMode::AlwaysEnabled)
    .run_or_abort()

    #Native theme

    native_theme() reports the appearance Proton follows and needs no running session. It mirrors Electron's nativeTheme query surface:

    let theme = @proton.native_theme() catch {
    error => abort(error.message())
    }
    let dark = theme.should_use_dark_colors()
    let high_contrast = theme.should_use_high_contrast_colors()
    let source = theme.theme_source()

    native_theme_set_source assigns the application-level source, mirroring nativeTheme.themeSource. System follows the operating system; Light and Dark win over it for every window that does not configure its own theme. Per-window WindowHandle::set_window_theme stays authoritative for that window's chrome.

    @proton.native_theme_set_source(@proton.WindowThemePreference::Dark) catch {
    error => abort(error.message())
    }

    App::on_native_theme_change registers the application-level equivalent of Electron's nativeTheme.on("updated"). It runs when the operating system appearance changes (system theme, high contrast) or when the application moves themeSource. The handler runs on the application task group and receives the new snapshot; Electron hands the event no payload, so Proton supplies one instead of making every handler re-read a value that may already have moved on. One event is raised per observable change: repeating system broadcasts and redundant themeSource writes do not raise another.

    @proton.html("Theme aware", "<main><h1>Hello</h1></main>")
    .on_native_theme_change(fn(theme) noraise {
    // theme.should_use_dark_colors(), theme.should_use_high_contrast_colors()
    })
    .run_or_abort()

    Renderer prefers-color-scheme keeps following the operating system: the current CEF public API exposes no renderer color-scheme override. A themeSource override therefore changes the application snapshot and the native window chrome, not the page media query. examples/77_native_theme contains the manual review flow, including a native readback after every override.

    Platform notes: macOS follows the application-level effective appearance and the accessibility contrast option; Linux follows GTK's theme name and prefer-dark setting. Windows announces the change through the top-level window message broadcast, so an application that runs with no window at all reports the change when a window exists again.

    #Application locale

    App::locale selects an immutable application locale before native runtime creation. The resolved locale and preferred language order are available from application, window, and command contexts and are also supplied to CEF. Applications own their translation catalogs and localized content; Proton only owns platform discovery, propagation, standard native menu labels, and its framework failure shell.

    #Learn more

    • Runnable demos live in the repository's examples/ directory.
    • The CLI covers the project workflow: proton_cli new, proton_cli cef setup, proton_cli dev, proton_cli build, and proton_cli package.

    Typed commands and events are inert shared descriptors. Ordinary applications can bind implementations directly with CommandRegistrar::bind; command codegen is optional. Use response enums for expected business outcomes and ClientFailure for transport or unexpected execution failures. CommandContext::emit_to_caller targets the issuing page (emit remains an alias); WindowContext::events returns an explicit destination for that window. Broadcast by retaining only the destinations your application intends to notify and releasing them with their window lifecycle. Events are live, best-effort notifications, not replayable state.

    SessionHandle::clear_storage_data supports Cookies, HttpCache, and AllSupported. Profile-directory categories such as IndexedDB and localStorage are intentionally not cleared while a CEF session is live.

    AppEntry

    Declarative entry content loaded into a Proton application window.

    CommandContext

    Request-scoped context supplied to typed application command handlers.

    Lifecycle-owned task and event capabilities are added by the application runner; the registrar keeps handlers independent from transport details.

    CommandRegistrar

    Startup-only capability for binding typed command descriptors to handlers.

    CommandWindow

    Window-scoped application capabilities available to one command request. The native window identity and implementation remain owned by the Proton runtime; extensions can only invoke these semantic operations.

    Locale

    A canonical RFC 5646 language tag.

    LocaleParseError

    Failures produced while parsing an RFC 5646 language tag.

    PermissionScopeValidationError

    A stable validation failure for an extension's renderer permission scope.

    AppCleanupError

    pub(all) suberror AppCleanupError {
    CommandExtension(CommandExtensionLifecycleError)
    LifecycleHook(LifecycleHookError)
    WindowDestroy(status~ : Int, detail~ : String)
    RuntimeDestroy(status~ : Int, detail~ : String)
    } derive(
    Debug
    )

    A failure from one stage of best-effort application teardown.

    AppCleanupError::message

    fn AppCleanupError::message(self : AppCleanupError) -> String

    AppCleanupError::output

    fn AppCleanupError::output(self : AppCleanupError, logger : &Logger) -> Unit

    AppCleanupError::to_string

    fn AppCleanupError::to_string(self : AppCleanupError) -> String

    AppConfigurationError

    pub(all) suberror AppConfigurationError {
    InvalidSetting(name~ : String, message~ : String)
    ExtensionDependencyCycle(extension_id~ : String)
    ExtensionUnavailable(extension_id~ : String, requested_by~ : String?, state~ : String)
    ExtensionAdaptationFailed(extension_id~ : String, error~ :
    ExtensionAdapterError
    )
    InvalidJavaScriptNamespace(js_namespace~ : String)
    InvalidJavaScriptApi(js_namespace~ : String, api_name~ : String)
    InvalidEntryUrl(url~ : String, reason~ : String)
    InvalidRendererCapability(detail~ : String)
    } derive(
    Debug
    )

    Failures while resolving and validating an application's configuration.

    AppConfigurationError::message

    fn AppConfigurationError::message(self : AppConfigurationError) -> String

    AppConfigurationError::output

    fn AppConfigurationError::output(self : AppConfigurationError, logger : &Logger) -> Unit

    AppConfigurationError::to_string

    fn AppConfigurationError::to_string(self : AppConfigurationError) -> String

    AppControlError

    pub(all) suberror AppControlError {
    InvalidProtocolScheme(scheme~ : String)
    UndeclaredProtocolScheme(scheme~ : String)
    InvalidExecutable(path~ : String)
    NativeControlFailure(action~ : String, status~ : Int, detail~ : String)
    } derive(Eq,
    Debug
    )

    Failures from application-level desktop and process controls.

    AppControlError::equal

    AppControlError::message

    fn AppControlError::message(self : AppControlError) -> String

    AppControlError::not_equal

    fn AppControlError::not_equal(x : AppControlError, y : AppControlError) -> Bool

    AppControlError::output

    fn AppControlError::output(self : AppControlError, logger : &Logger) -> Unit

    AppControlError::to_string

    fn AppControlError::to_string(self : AppControlError) -> String

    AppEntryError

    pub(all) suberror AppEntryError {
    ReadFailed(path~ : String, detail~ : String)
    PlatformLoad(action~ : String, status~ : Int, detail~ : String)
    ClosedDuringStartup
    } derive(
    Debug
    )

    Failures while loading the application's initial document.

    AppEntryError::message

    fn AppEntryError::message(self : AppEntryError) -> String

    AppEntryError::output

    fn AppEntryError::output(self : AppEntryError, logger : &Logger) -> Unit

    AppEntryError::to_string

    fn AppEntryError::to_string(self : AppEntryError) -> String

    AppMetadataError

    pub(all) suberror AppMetadataError {
    MissingPackageMetadata
    MissingField(field~ : String)
    InvalidMetadata(detail~ : String)
    } derive(Eq,
    Debug
    )

    Failures while reading application metadata managed by Proton tooling.

    AppMetadataError::equal

    AppMetadataError::message

    fn AppMetadataError::message(self : AppMetadataError) -> String

    AppMetadataError::not_equal

    fn AppMetadataError::not_equal(x : AppMetadataError, y : AppMetadataError) -> Bool

    AppMetadataError::output

    fn AppMetadataError::output(self : AppMetadataError, logger : &Logger) -> Unit

    AppMetadataError::to_string

    fn AppMetadataError::to_string(self : AppMetadataError) -> String

    AppPathError

    pub(all) suberror AppPathError {
    MissingApplicationIdentifier
    InvalidIdentifier(identifier~ : String)
    MissingHomeDirectory(platform~ : String)
    MissingEnvironmentPath(name~ : String, platform~ : String)
    MissingExecutablePath
    UnsupportedPath(kind~ : String, platform~ : String)
    InvalidPathOverride(kind~ : String, path~ : String, reason~ : String)
    SystemPath(kind~ : String, status~ : Int, detail~ : String)
    PlatformProbe(status~ : Int, detail~ : String)
    } derive(Eq,
    Debug
    )

    Failures while resolving framework-owned application paths.

    AppPathError::equal

    AppPathError::message

    fn AppPathError::message(self : AppPathError) -> String

    AppPathError::not_equal

    fn AppPathError::not_equal(x : AppPathError, y : AppPathError) -> Bool

    AppRunError

    pub(all) suberror AppRunError {
    EventLoopError(String)
    ConfigurationError(AppConfigurationError)
    LoggingInitializationFailed(detail~ : String)
    UnsupportedNativeFeature(feature~ : String)
    RuntimeOperationFailed(action~ : String, status~ : Int, detail~ : String)
    CommandExtensionLifecycleError(CommandExtensionLifecycleError)
    LifecycleHookError(LifecycleHookError)
    EntryLoadError(AppEntryError)
    BridgeStartupError(BridgeDiagnostic)
    BridgeRuntimeError(BridgeDiagnostic)
    CleanupFailed(primary~ : String?, failures~ : Array[AppCleanupError])
    UnexpectedTaskFailure(detail~ : String)
    } derive(
    Debug
    )

    Failures produced while configuring, starting, or running an application.

    AppRunError::message

    fn AppRunError::message(self : AppRunError) -> String

    AppRunError::output

    fn AppRunError::output(self : AppRunError, logger : &Logger) -> Unit

    AppRunError::to_string

    fn AppRunError::to_string(self : AppRunError) -> String

    CommandExtensionLifecycleError

    pub(all) suberror CommandExtensionLifecycleError {
    ApplicationRegistrationFailed(detail~ : String)
    RegistrationFailed(extension_id~ : String, detail~ : String)
    EventSourceStartFailed(extension_id~ : String, detail~ : String)
    DestroyFailed(extension_id~ : String, detail~ : String)
    } derive(
    Debug
    )

    Failures while starting or stopping command extensions.

    CommandExtensionLifecycleError::message

    CommandExtensionLifecycleError::output

    CommandExtensionLifecycleError::to_string

    LifecycleHookError

    pub(all) suberror LifecycleHookError {
    ApplicationStart(index~ : Int, detail~ : String)
    ApplicationShutdown(index~ : Int, detail~ : String)
    WindowReady(index~ : Int, detail~ : String)
    WindowClose(index~ : Int, detail~ : String)
    } derive(
    Debug
    )

    Failures produced by application or window lifecycle hooks.

    LifecycleHookError::message

    fn LifecycleHookError::message(self : LifecycleHookError) -> String

    LifecycleHookError::output

    fn LifecycleHookError::output(self : LifecycleHookError, logger : &Logger) -> Unit

    LifecycleHookError::to_string

    fn LifecycleHookError::to_string(self : LifecycleHookError) -> String

    NativeImageError

    pub(all) suberror NativeImageError {
    OperationFailed(action~ : String, status~ : Int, detail~ : String)
    } derive(Eq,
    Debug
    )

    A failure while creating, reading, or converting a native image.

    NativeImageError::equal

    NativeImageError::message

    fn NativeImageError::message(self : NativeImageError) -> String

    NativeImageError::not_equal

    fn NativeImageError::not_equal(x : NativeImageError, y : NativeImageError) -> Bool

    NativeImageError::output

    fn NativeImageError::output(self : NativeImageError, logger : &Logger) -> Unit

    NativeImageError::to_string

    fn NativeImageError::to_string(self : NativeImageError) -> String

    NativeThemeError

    pub(all) suberror NativeThemeError {
    NativeThemeUnavailable(status~ : Int, detail~ : String)
    }

    Raised when the operating system appearance cannot be read.

    NativeThemeError::message

    fn NativeThemeError::message(self : NativeThemeError) -> String

    NativeThemeError::output

    fn NativeThemeError::output(self : NativeThemeError, logger : &Logger) -> Unit

    NativeThemeError::to_string

    fn NativeThemeError::to_string(self : NativeThemeError) -> String

    NotificationDeliveryError

    pub(all) suberror NotificationDeliveryError {
    NativeFailure(status~ : Int, detail~ : String)
    WaitInterrupted(detail~ : String)
    DeliveryFailed(message~ : String)
    } derive(Eq,
    Debug
    )

    Failures while starting or waiting for native notification delivery.

    NotificationDeliveryError::equal

    NotificationDeliveryError::message

    NotificationDeliveryError::not_equal

    ScreenQueryError

    pub(all) suberror ScreenQueryError {
    QueryFailed(status~ : Int, detail~ : String)
    } derive(
    Debug
    )

    Failures while querying connected displays.

    ScreenQueryError::message

    fn ScreenQueryError::message(self : ScreenQueryError) -> String

    ScreenQueryError::output

    fn ScreenQueryError::output(self : ScreenQueryError, logger : &Logger) -> Unit

    ScreenQueryError::to_string

    fn ScreenQueryError::to_string(self : ScreenQueryError) -> String

    SystemLocaleError

    pub(all) suberror SystemLocaleError {
    NativeQuery(status~ : Int, detail~ : String)
    } derive(
    Debug
    )

    Failures produced while querying the operating system's language order.

    SystemLocaleError::message

    fn SystemLocaleError::message(self : SystemLocaleError) -> String

    SystemLocaleError::output

    fn SystemLocaleError::output(self : SystemLocaleError, logger : &Logger) -> Unit

    SystemLocaleError::to_string

    fn SystemLocaleError::to_string(self : SystemLocaleError) -> String

    WindowSessionError

    pub(all) suberror WindowSessionError {
    UnknownWindow(id~ : String)
    AlreadyOpen(id~ : String)
    ApplicationQuitting
    StaleWindow(id~ : String)
    UnknownView(id~ : String)
    AlreadyExists(id~ : String)
    StaleView(id~ : String)
    Cancelled
    OperationFailed(action~ : String, status~ : Int, detail~ : String)
    StartupFailed(id~ : String, error~ : AppRunError)
    } derive(
    Debug
    )

    Failures from runtime window lookup, creation, or control.

    WindowSessionError::message

    fn WindowSessionError::message(self : WindowSessionError) -> String

    WindowSessionError::output

    fn WindowSessionError::output(self : WindowSessionError, logger : &Logger) -> Unit

    WindowSessionError::to_string

    fn WindowSessionError::to_string(self : WindowSessionError) -> String

    AccessibilityMode

    pub(all) enum AccessibilityMode {
    Automatic
    AlwaysEnabled
    } derive(Eq,
    Debug
    )

    Controls when Proton enables the browser accessibility tree.

    AccessibilityMode::equal

    AccessibilityMode::not_equal

    fn AccessibilityMode::not_equal(x : AccessibilityMode, y : AccessibilityMode) -> Bool

    App

    type App

    High-level application facade for ordinary Proton apps.

    App::accessibility

    fn App::accessibility(self : App, mode : AccessibilityMode) -> App

    Controls when Proton enables Chromium's accessibility tree.

    Automatic follows assistive-technology activity where the platform can report it. AlwaysEnabled keeps the tree available for the whole runtime.

    App::add_window

    fn App::add_window(self : App, id : String, title : String, entry :
    AppEntry
    , width? : Int, height? : Int, size_hint? : WindowSizeHint, titlebar_style? : TitlebarStyle, theme? : WindowThemePreference, open_on_start? : Bool) -> App

    Adds a secondary window owned by the standard application lifecycle.

    App::app_lifecycle

    fn[State] App::app_lifecycle(self : App, on_start~ : async (ApplicationContext) -> State, on_shutdown~ : async (State) -> Unit) -> App

    Adds a paired application lifecycle hook.

    The startup state is passed to shutdown. Completed hooks shut down in reverse order, including when a later startup hook fails.

    App::bridge_startup_timeout_ms

    fn App::bridge_startup_timeout_ms(self : App, timeout_ms : Int) -> App

    Sets the maximum time allowed for the native bridge to become ready.

    App::capability

    Grants one typed extension capability to its renderer targets.

    The default target is the configured entry of the primary window. The capability registers its backend handlers and exposes only its validated scope to those renderers.

    App::commands

    fn App::commands(self : App, register : (
    CommandRegistrar
    ) -> Unit raise, targets? : Array[RendererTarget]) -> App

    Adds one package registrar for typed application commands.

    Registration runs before any window is created and is sealed before the renderer bridge starts accepting requests. Only the operations registered by this callback are granted to its targets; the primary configured entry is the default target.

    App::data_dir

    fn App::data_dir(self : App) -> String raise AppPathError

    Resolves the stable directory for this application's persistent native data. This function resolves the path but does not create the directory.

    App::debug

    fn App::debug(self : App, enabled? : Bool) -> App

    Enables or disables runtime debug mode.

    App::debug_level

    fn App::debug_level(self : App, debug : Int) -> App

    Sets the runtime debug level.

    App::document_extension

    fn App::document_extension(self : App, extension : String) -> App

    Registers a document extension for single-instance launch forwarding. OS registration belongs to the package configuration.

    App::entry_asset

    fn App::entry_asset(self : App, path : String) -> App

    Overrides the primary app entry with an asset path.

    App::entry_file

    fn App::entry_file(self : App, path : String) -> App

    Overrides the primary app entry with a file path.

    App::entry_html

    fn App::entry_html(self : App, html : String) -> App

    Overrides the primary app entry with inline HTML.

    App::entry_url

    fn App::entry_url(self : App, url : String) -> App

    Overrides the primary app entry with a URL.

    App::headless

    fn App::headless(self : App, enabled? : Bool) -> App

    Enables or disables off-screen headless rendering for the application.

    Headless mode does not create a native top-level window, so native dialogs, menus, title bars, and other window-bound UI are unavailable. Set PROTON_HEADLESS=1 to force this mode for automated test runs.

    App::identifier

    fn App::identifier(self : App, identifier : String) -> App

    Sets the canonical identifier for an application without project metadata.

    App::last_window_closed_policy

    fn App::last_window_closed_policy(self : App, policy : LastWindowClosedPolicy) -> App

    Chooses whether closing the last window exits the application or leaves it running so a later launch input can open another window.

    App::load_config

    fn App::load_config(self : App) -> App

    Loads this application's identifier from managed Proton metadata.

    Development runs read proton.project.json. Packaged applications read the sanitized proton-package.json staged beside the executable.

    App::locale

    Selects the immutable locale used by this application runtime.

    App::menu

    fn App::menu(self : App, menu : MenuBar) -> App

    Sets the app-level native menu bar.

    App::name

    fn App::name(self : App) -> String raise AppMetadataError

    Returns the product name from managed development or packaged metadata.

    App::on_browser_event

    fn App::on_browser_event(self : App, handler : async (BrowserHandle, BrowserEvent) -> Unit noraise) -> App

    Observes events for every main browser page: loading changes, main-frame navigations, title updates, load failures, and page-search results.

    App::on_certificate_error

    fn App::on_certificate_error(self : App, handler : async (BrowserHandle, CertificateError) -> BrowserPermissionDecision noraise) -> App

    Reviews invalid TLS certificates. The default is denial.

    App::on_download_event

    fn App::on_download_event(self : App, handler : async (BrowserHandle, DownloadEvent) -> Unit noraise) -> App

    Observes download progress and terminal states.

    App::on_download_request

    fn App::on_download_request(self : App, handler : async (BrowserHandle, DownloadRequest) -> DownloadDecision noraise) -> App

    Reviews downloads before CEF chooses a destination.

    App::on_launch_input

    fn App::on_launch_input(self : App, handler : async (ApplicationContext, RuntimeLaunchInput) -> Unit noraise) -> App

    App::on_media_permission_request

    fn App::on_media_permission_request(self : App, handler : async (BrowserHandle, MediaPermissionRequest) -> BrowserPermissionDecision noraise) -> App

    Reviews camera, microphone, and display-capture requests. The default is denial.

    App::on_native_theme_change

    fn App::on_native_theme_change(self : App, handler : async (NativeTheme) -> Unit noraise) -> App

    Registers an application-level handler for operating system appearance changes.

    Mirrors Electron's nativeTheme.on("updated"), which fires when the operating system appearance changes or when native_theme_set_source moves the application-level source. The handler runs on the application task group and never on the startup path. Electron hands the event no payload; the new snapshot is passed instead, so the handler does not have to read a value that may already have moved on.

    App::on_navigation_request

    fn App::on_navigation_request(self : App, handler : async (BrowserHandle, NavigationRequest) -> NavigationDecision noraise) -> App

    Reviews top-level navigations asynchronously. The native browser cancels a pending navigation until this handler returns, then replays it exactly once when allowed.

    App::on_new_window_request

    fn App::on_new_window_request(self : App, handler : async (BrowserHandle, NewWindowRequest) -> NewWindowDecision noraise) -> App

    Reviews requests for a new browsing context, including window.open, target-blank links, and modified link clicks. New Proton windows must already be declared with add_window(..., open_on_start=false).

    App::on_permission_request

    fn App::on_permission_request(self : App, handler : async (BrowserHandle, PermissionRequest) -> BrowserPermissionDecision noraise) -> App

    Applies one policy to certificate and media permission requests.

    App::on_thumbar_button_click

    fn App::on_thumbar_button_click(self : App, handler : async (WindowHandle, String) -> Unit noraise) -> App

    Registers a handler for taskbar thumbnail-toolbar clicks.

    The handler runs on the application task group with the window that owns the toolbar and the id of the button that was clicked. Electron attaches one callback per button; Proton reports the identifier instead so rebuilding the toolbar cannot silently retarget a click. Windows raises the event; other platforms never do, because the thumbnail toolbar is Windows only.

    App::on_update_available

    fn App::on_update_available(self : App, handler : async (PendingUpdate) -> Unit noraise) -> App

    Registers an application-level handler for URL, file, and reopen inputs. Registers a handler for an update the channel offers.

    Registering one is what turns the automatic check on: an application that has not said what to do when an update exists is not asked to contact a server on launch. The handler runs after the application is up, on the application task group, and never on the startup path.

    It is called with an update that has already been authenticated and found newer. Nothing has been downloaded and nothing will be until the handler asks for it.

    App::on_view_event

    fn App::on_view_event(self : App, handler : async (ViewHandle, ViewEvent) -> Unit noraise) -> App

    Observes events for every running web contents view: loading changes, main-frame navigations, title updates, load failures, page-search results, and close.

    App::on_window_close_request

    fn App::on_window_close_request(self : App, handler : async (WindowHandle) -> WindowCloseDecision noraise) -> App

    Intercepts user-initiated close requests without blocking the native UI thread. WindowHandle::close uses the same request path; forced cleanup is reserved for the session-owned destroy lifecycle.

    App::on_window_event

    fn App::on_window_event(self : App, handler : async (WindowHandle, WindowEvent) -> Unit noraise) -> App

    Observes coalesced native state changes for every running window.

    App::path

    fn App::path(self : App, kind : AppPathKind) -> String raise AppPathError

    Resolves a standard application path.

    UserData, SessionData, and Logs use the application's stable reverse-DNS identifier instead of its display name so package renames do not move persisted state.

    App::proxy

    fn App::proxy(self : App, server : String, bypass? : String) -> App

    Configures a startup-wide Chromium proxy. This is read when the native runtime starts and cannot be changed while the app is running.

    App::run

    async fn App::run(self : App) -> Unit raise AppRunError

    Runs the configured app through the native Proton runtime.

    App::run_or_abort

    async fn App::run_or_abort(self : App) -> Unit

    Runs the configured app and aborts with the error message on failure.

    App::session_partition

    fn App::session_partition(self : App, partition : String) -> App

    Uses an isolated persistent browser profile below the application's sessionData directory.

    App::set_app_logs_path

    fn App::set_app_logs_path(self : App, path? : String) -> App raise AppPathError

    Selects the application log directory before runtime startup.

    A custom absolute path is created when the application starts. Omitting the path selects Electron's default: the platform log directory on macOS and a logs directory inside UserData on Windows and Linux.

    App::set_path

    fn App::set_path(self : App, kind : AppPathKind, path : String) -> App raise AppPathError

    Overrides a standard application path before the application runtime starts.

    The path must be absolute and already exist, matching Electron's setPath validation. Runtime-owned paths such as SessionData and Logs are consumed by Proton startup in addition to being returned by App::path.

    App::single_instance

    fn App::single_instance(self : App, enabled? : Bool) -> App

    Ensures only one operating-system process owns this application identity. Later processes forward their URL, document, or reopen activation and exit.

    App::size

    fn App::size(self : App, width~ : Int, height~ : Int) -> App

    Sets the primary window size.

    App::theme

    fn App::theme(self : App, theme : WindowThemePreference) -> App

    Sets the primary window's native chrome theme.

    Explicit Light and Dark themes require platform support. System is portable and follows the platform's effective application appearance.

    App::title

    fn App::title(self : App, title : String) -> App

    Sets the primary window title.

    App::titlebar_style

    fn App::titlebar_style(self : App, style : TitlebarStyle) -> App

    Sets whether web content remains below or extends beneath the native titlebar. Overlay rendering is currently implemented on macOS and Windows.

    App::update_channel

    fn App::update_channel(self : App, endpoint : String, public_keys : Array[String], check_on_launch? : Bool, freshness_days? : Int) -> App

    Configures the signed update channel used by this application.

    App::url_scheme

    fn App::url_scheme(self : App, scheme : String) -> App

    Declares an application URL scheme for launch forwarding and protocol-client controls. Package configuration must declare the same scheme so distributed applications contain the required platform metadata.

    App::version

    fn App::version(self : App) -> String raise AppMetadataError

    Returns the application version from managed development or packaged metadata.

    App::web_request_cancel_prefix

    fn App::web_request_cancel_prefix(self : App, url_prefix : String) -> App

    Cancels browser requests whose URL starts with url_prefix.

    Matching is case-sensitive and applies to every browser session created by this application, including secondary windows and web contents views.

    App::web_request_header_prefix

    fn App::web_request_header_prefix(self : App, url_prefix : String, header_name : String, header_value : String) -> App

    Overrides a request header for URLs matching url_prefix.

    App::web_request_redirect_prefix

    fn App::web_request_redirect_prefix(self : App, url_prefix : String, target_url : String) -> App

    Redirects matching browser requests to target_url before loading.

    App::window_lifecycle

    fn[State] App::window_lifecycle(self : App, on_ready~ : async (WindowContext) -> State, on_close~ : async (State) -> Unit) -> App

    Adds a paired primary-window lifecycle hook.

    The ready state is passed to close. Completed hooks close in reverse order, including when a later ready hook fails.

    App::with_view

    fn App::with_view(self : App, id : String, config : ViewConfig) -> App

    Attaches a web contents view to the primary window at startup, the declarative counterpart of WindowHandle::add_view: the view is created with the window and can later be found through WindowHandle::view(id) or observed through App::on_view_event. Use the imperative WindowHandle::add_view for views whose lifetime is dynamic.

    AppPathKind

    pub(all) enum AppPathKind {
    Home
    AppData
    UserData
    SessionData
    Temp
    Executable
    Logs
    Assets
    Module
    Desktop
    Documents
    Downloads
    Music
    Pictures
    Videos
    Recent
    } derive(Eq,
    Debug
    )

    Standard application paths corresponding to Electron's high-frequency app.getPath names.

    AppPathKind::equal

    fn AppPathKind::equal(AppPathKind, AppPathKind) -> Bool

    AppPathKind::not_equal

    fn AppPathKind::not_equal(x : AppPathKind, y : AppPathKind) -> Bool

    ApplicationContext

    pub struct ApplicationContext {
    tasks :
    TaskGroup
    [Unit]
    windows : WindowManager
    locale_preferences :
    LocalePreferences

    request_quit : () -> Unit
    application_identifier : String
    application_executable : String
    application_arguments : Array[String]
    url_schemes : Array[String]
    }

    Application-lifetime capabilities supplied to startup hooks.

    ApplicationContext::exit

    fn ApplicationContext::exit(self : ApplicationContext, exit_code? : Int) -> Unit

    Immediately terminates the process with exit_code.

    This skips window close interception and lifecycle shutdown hooks. Any relaunches already scheduled through relaunch are started first.

    ApplicationContext::is_default_protocol_client

    fn ApplicationContext::is_default_protocol_client(self : ApplicationContext, scheme : String, executable? : String, arguments? : Array[String]) -> Bool raise AppControlError

    Reports whether this application handles a declared URL scheme by default.

    ApplicationContext::locale

    Returns the immutable application locale selected at startup.

    ApplicationContext::preferred_languages

    Returns the application's ordered language preferences.

    ApplicationContext::quit

    fn ApplicationContext::quit(self : ApplicationContext) -> Unit

    Requests an orderly application shutdown.

    Proton closes every open window, runs configured close interception, and destroys the native runtime after all windows have closed. A denied window close cancels this quit request.

    ApplicationContext::relaunch

    fn ApplicationContext::relaunch(self : ApplicationContext, options? : RelaunchOptions) -> Unit raise AppControlError

    Schedules a new application instance after the current instance exits.

    Calling this method multiple times schedules multiple instances. It does not quit the current application; call quit or exit separately.

    ApplicationContext::remove_default_protocol_client

    fn ApplicationContext::remove_default_protocol_client(self : ApplicationContext, scheme : String, executable? : String, arguments? : Array[String]) -> Bool raise AppControlError

    Removes this application as the default handler for a declared URL scheme.

    Electron exposes removal on macOS and Windows. Linux returns false.

    ApplicationContext::set_as_default_protocol_client

    fn ApplicationContext::set_as_default_protocol_client(self : ApplicationContext, scheme : String, executable? : String, arguments? : Array[String]) -> Bool raise AppControlError

    Sets this application as the default handler for a declared URL scheme.

    executable and arguments match Electron's Windows-only command override. Other platforms use the packaged application identity.

    ApplicationContext::task_group

    Returns the structured task group owned by this application.

    ApplicationContext::windows

    Returns the window manager owned by this running application.

    BridgeDiagnostic

    pub(all) struct BridgeDiagnostic {
    stage : String
    code : String
    message : String
    page_instance : String
    url : String
    owner : String?
    source_url : String?
    source_line : String?
    line : Int?
    column : Int?
    stack : String?
    additional_failure_count : Int?
    details_truncated : Bool
    } derive(Eq,
    Debug
    )

    Structured information about a bridge bootstrap or runtime failure.

    BridgeDiagnostic::equal

    BridgeDiagnostic::not_equal

    fn BridgeDiagnostic::not_equal(x : BridgeDiagnostic, y : BridgeDiagnostic) -> Bool

    BrowserEvent

    pub(all) enum BrowserEvent {
    LoadingChanged(is_loading~ : Bool)
    DidStartLoading
    DidFinishLoad
    Navigated(url~ : String)
    TitleUpdated(title~ : String)
    LoadFailed(url~ : String, error_code~ : Int, error_text~ : String)
    FoundInPage(result~ : FindInPageResult)
    PdfPrinted(result~ : PdfPrintResult)
    ResourceResponse(url~ : String, status_code~ : Int)
    ResourceCompleted(url~ : String, status~ : Int, received_bytes~ : Int64)
    ResourceRequested(url~ : String, request_method~ : String, will_cancel~ : Bool)
    RendererProcessTerminated(url~ : String, status~ : Int, error_code~ : Int, detail~ : String)
    } derive(Eq,
    Debug
    )

    An observed lifecycle change for a window's main browser page.

    BrowserEvent::equal

    BrowserEvent::not_equal

    fn BrowserEvent::not_equal(x : BrowserEvent, y : BrowserEvent) -> Bool

    BrowserHandle

    pub struct BrowserHandle {
    id : String
    native_id : Int64
    load_browser_url : (String) -> Unit raise WindowSessionError
    load_browser_html : (String, String) -> Unit raise WindowSessionError
    eval_browser_script : (String) -> Unit raise WindowSessionError
    focus_browser : () -> Unit raise WindowSessionError
    send_browser_command : (String, Int?) -> Unit raise WindowSessionError
    download_browser_url : (String) -> Unit raise WindowSessionError
    print_browser : () -> Unit raise WindowSessionError
    print_browser_to_pdf : (String, PdfPrintOptions) -> Int raise WindowSessionError
    find_browser_in_page : (String, Bool, Bool, Bool) -> Int raise WindowSessionError
    stop_browser_find : (Bool) -> Unit raise WindowSessionError
    set_browser_zoom_percent : (Int) -> Unit raise WindowSessionError
    read_browser_zoom_percent : () -> Int raise WindowSessionError
    set_browser_audio_muted : (Bool) -> Unit raise WindowSessionError
    read_browser_audio_muted : () -> Bool raise WindowSessionError
    read_browser_navigation_state : () -> (Bool, Bool) raise WindowSessionError
    read_browser_focused : () -> Bool raise WindowSessionError
    read_browser_devtools_opened : () -> Bool raise WindowSessionError
    read_browser_state : () -> BrowserState raise WindowSessionError
    session_handle : SessionHandle
    }

    BrowserHandle::back

    fn BrowserHandle::back(self : BrowserHandle) -> Unit raise WindowSessionError

    BrowserHandle::can_go_back

    fn BrowserHandle::can_go_back(self : BrowserHandle) -> Bool raise WindowSessionError

    Returns whether the main browser can navigate to a previous history entry.

    BrowserHandle::can_go_forward

    fn BrowserHandle::can_go_forward(self : BrowserHandle) -> Bool raise WindowSessionError

    Returns whether the main browser can navigate to a later history entry.

    BrowserHandle::cancel_download

    fn BrowserHandle::cancel_download(self : BrowserHandle, download_id : Int) -> Unit raise WindowSessionError

    BrowserHandle::close_devtools

    fn BrowserHandle::close_devtools(self : BrowserHandle) -> Unit raise WindowSessionError

    BrowserHandle::copy

    fn BrowserHandle::copy(self : BrowserHandle) -> Unit raise WindowSessionError

    Copies the current selection in the focused frame.

    BrowserHandle::cut

    fn BrowserHandle::cut(self : BrowserHandle) -> Unit raise WindowSessionError

    Cuts the current selection in the focused frame.

    BrowserHandle::delete

    fn BrowserHandle::delete(self : BrowserHandle) -> Unit raise WindowSessionError

    Deletes the current selection in the focused frame.

    BrowserHandle::download_url

    fn BrowserHandle::download_url(self : BrowserHandle, url : String) -> Unit raise WindowSessionError

    Starts downloading url without navigating the page. The request uses the app's download approval and progress handlers. CEF does not support Electron's optional custom request headers for this operation.

    BrowserHandle::eval

    fn BrowserHandle::eval(self : BrowserHandle, script : String) -> Unit raise WindowSessionError

    BrowserHandle::find_in_page

    fn BrowserHandle::find_in_page(self : BrowserHandle, text : String, forward? : Bool, match_case? : Bool, find_next? : Bool) -> Int raise WindowSessionError

    Starts or advances a page search and returns its request id. Set find_next=true to begin a new search session, matching Electron's findInPage option; leave it false to advance the current session.

    BrowserHandle::focus

    fn BrowserHandle::focus(self : BrowserHandle) -> Unit raise WindowSessionError

    Focuses the web page, matching Electron webContents.focus().

    BrowserHandle::forward

    fn BrowserHandle::forward(self : BrowserHandle) -> Unit raise WindowSessionError

    BrowserHandle::is_audio_muted

    fn BrowserHandle::is_audio_muted(self : BrowserHandle) -> Bool raise WindowSessionError

    Returns whether audio produced by the main browser page is muted.

    BrowserHandle::is_devtools_opened

    fn BrowserHandle::is_devtools_opened(self : BrowserHandle) -> Bool raise WindowSessionError

    Returns whether this web contents currently has an open DevTools view.

    BrowserHandle::is_focused

    fn BrowserHandle::is_focused(self : BrowserHandle) -> Bool raise WindowSessionError

    Returns whether the web page currently owns focus.

    BrowserHandle::load_html

    fn BrowserHandle::load_html(self : BrowserHandle, html : String, base_url : String) -> Unit raise WindowSessionError

    BrowserHandle::load_url

    fn BrowserHandle::load_url(self : BrowserHandle, url : String) -> Unit raise WindowSessionError

    BrowserHandle::open_devtools

    fn BrowserHandle::open_devtools(self : BrowserHandle) -> Unit raise WindowSessionError

    BrowserHandle::paste

    fn BrowserHandle::paste(self : BrowserHandle) -> Unit raise WindowSessionError

    Pastes clipboard contents into the focused frame.

    BrowserHandle::paste_and_match_style

    fn BrowserHandle::paste_and_match_style(self : BrowserHandle) -> Unit raise WindowSessionError

    Pastes clipboard contents using the destination's current style.

    BrowserHandle::print

    fn BrowserHandle::print(self : BrowserHandle) -> Unit raise WindowSessionError

    Opens the platform print flow for the main browser contents.

    BrowserHandle::print_to_pdf

    fn BrowserHandle::print_to_pdf(self : BrowserHandle, path : String, options? : PdfPrintOptions) -> Int raise WindowSessionError

    Starts printing the main browser contents to path and returns a request id. Completion is delivered as BrowserEvent::PdfPrinted.

    BrowserHandle::redo

    fn BrowserHandle::redo(self : BrowserHandle) -> Unit raise WindowSessionError

    Redoes the most recently undone edit in the focused frame.

    BrowserHandle::reload

    fn BrowserHandle::reload(self : BrowserHandle, ignore_cache? : Bool) -> Unit raise WindowSessionError

    BrowserHandle::select_all

    fn BrowserHandle::select_all(self : BrowserHandle) -> Unit raise WindowSessionError

    Selects all editable content in the focused frame.

    BrowserHandle::session

    Returns the browser session used by this main page.

    BrowserHandle::set_audio_muted

    fn BrowserHandle::set_audio_muted(self : BrowserHandle, muted : Bool) -> Unit raise WindowSessionError

    Mutes or unmutes audio produced by the main browser page.

    BrowserHandle::set_zoom_percent

    fn BrowserHandle::set_zoom_percent(self : BrowserHandle, zoom_percent : Int) -> Unit raise WindowSessionError

    Sets the main browser zoom from 25% through 500%.

    BrowserHandle::state

    Reads the current main browser page state.

    BrowserHandle::stop

    fn BrowserHandle::stop(self : BrowserHandle) -> Unit raise WindowSessionError

    BrowserHandle::stop_find_in_page

    fn BrowserHandle::stop_find_in_page(self : BrowserHandle, clear_selection? : Bool) -> Unit raise WindowSessionError

    Stops the active page search. Set clear_selection=false to preserve the current match highlight.

    BrowserHandle::toggle_devtools

    fn BrowserHandle::toggle_devtools(self : BrowserHandle) -> Unit raise WindowSessionError

    Toggles the DevTools view for this web contents.

    BrowserHandle::undo

    fn BrowserHandle::undo(self : BrowserHandle) -> Unit raise WindowSessionError

    Undoes the most recent edit in the focused frame.

    BrowserHandle::window_id

    fn BrowserHandle::window_id(self : BrowserHandle) -> String

    BrowserHandle::zoom_percent

    fn BrowserHandle::zoom_percent(self : BrowserHandle) -> Int raise WindowSessionError

    Returns the main browser zoom percentage.

    BrowserPermissionDecision

    pub(all) enum BrowserPermissionDecision {
    Allow
    Deny
    } derive(Eq,
    Debug
    )

    BrowserPermissionDecision::equal

    BrowserPermissionDecision::not_equal

    BrowserState

    pub(all) struct BrowserState {
    url : String
    title : String
    is_loading : Bool
    can_go_back : Bool
    can_go_forward : Bool
    } derive(Eq,
    Debug
    )

    A point-in-time snapshot of a window's main browser page.

    BrowserState::equal

    BrowserState::not_equal

    fn BrowserState::not_equal(x : BrowserState, y : BrowserState) -> Bool

    CertificateError

    pub(all) struct CertificateError {
    url : String
    error_code : Int
    } derive(Eq,
    Debug
    )

    CertificateError::equal

    CertificateError::not_equal

    fn CertificateError::not_equal(x : CertificateError, y : CertificateError) -> Bool

    pub(all) struct Cookie {
    name : String
    value : String
    domain : String
    path : String
    secure : Bool
    http_only : Bool
    same_site : CookieSameSite
    expiration_date : Double?
    } derive(Eq,
    Debug
    )

    One cookie returned by the browser session.

    Cookie::equal

    fn Cookie::equal(Cookie, Cookie) -> Bool

    Cookie::not_equal

    fn Cookie::not_equal(x : Cookie, y : Cookie) -> Bool

    Cookie::to_repr

    CookieSameSite

    pub(all) enum CookieSameSite {
    Unspecified
    NoRestriction
    Lax
    Strict
    } derive(Eq,
    Debug
    )

    SameSite policy for a browser cookie.

    CookieSameSite::equal

    CookieSameSite::not_equal

    fn CookieSameSite::not_equal(x : CookieSameSite, y : CookieSameSite) -> Bool

    DownloadDecision

    pub(all) enum DownloadDecision {
    Deny
    ShowSaveDialog
    SaveTo(String)
    } derive(Eq,
    Debug
    )

    DownloadDecision::equal

    DownloadDecision::not_equal

    fn DownloadDecision::not_equal(x : DownloadDecision, y : DownloadDecision) -> Bool

    DownloadEvent

    pub(all) struct DownloadEvent {
    id : Int
    state : String
    received_bytes : Int64
    total_bytes : Int64
    percent : Int
    } derive(Eq,
    Debug
    )

    DownloadEvent::equal

    DownloadEvent::not_equal

    fn DownloadEvent::not_equal(x : DownloadEvent, y : DownloadEvent) -> Bool

    DownloadRequest

    pub(all) struct DownloadRequest {
    id : Int
    url : String
    suggested_name : String
    } derive(Eq,
    Debug
    )

    DownloadRequest::equal

    DownloadRequest::not_equal

    fn DownloadRequest::not_equal(x : DownloadRequest, y : DownloadRequest) -> Bool

    FindInPageResult

    pub(all) struct FindInPageResult {
    request_id : Int
    active_match_ordinal : Int
    matches : Int
    selection_x : Int
    selection_y : Int
    selection_width : Int
    selection_height : Int
    final_update : Bool
    } derive(Eq,
    Debug
    )

    One update from an active page search. The selection rectangle uses the target web contents coordinate space.

    FindInPageResult::equal

    FindInPageResult::not_equal

    fn FindInPageResult::not_equal(x : FindInPageResult, y : FindInPageResult) -> Bool

    JumpListCategory

    pub(all) struct JumpListCategory {
    kind : JumpListCategoryKind
    name : String
    items : Array[JumpListItem]
    }

    One category of the custom jump list, mirroring Electron's JumpListCategory.

    JumpListCategoryKind

    pub(all) enum JumpListCategoryKind {
    Tasks
    Custom
    Recent
    Frequent
    } derive(Eq,
    Debug
    )

    The kind of a jump list category, mirroring Electron's type property.

    JumpListCategoryKind::equal

    JumpListCategoryKind::not_equal

    JumpListItem

    pub(all) struct JumpListItem {
    kind : JumpListItemKind
    path : String
    arguments : String
    title : String
    description : String
    icon_path : String
    icon_index : Int
    working_directory : String
    }

    One item inside a custom jump list category.

    Empty strings mean "not set", which is how Electron treats omitted properties: a task needs path and title, a file link needs path, and a separator needs neither.

    JumpListItemKind

    pub(all) enum JumpListItemKind {
    Task
    Separator
    File
    } derive(Eq,
    Debug
    )

    The kind of a jump list item, mirroring Electron's type property.

    JumpListItemKind::equal

    JumpListItemKind::not_equal

    fn JumpListItemKind::not_equal(x : JumpListItemKind, y : JumpListItemKind) -> Bool

    JumpListResult

    pub(all) enum JumpListResult {
    Ok
    Error
    InvalidSeparator
    FileTypeRegistrationError
    CustomCategoryAccessDenied
    Unsupported
    } derive(Eq,
    Debug
    )

    The result of a jump list update, mirroring the strings Electron returns from setJumpList.

    JumpListResult::equal

    JumpListResult::not_equal

    fn JumpListResult::not_equal(x : JumpListResult, y : JumpListResult) -> Bool

    LastWindowClosedPolicy

    pub(all) enum LastWindowClosedPolicy {
    Quit
    KeepRunning
    } derive(Eq,
    Debug
    )

    Controls what Proton does after the last application window closes.

    LastWindowClosedPolicy::equal

    LastWindowClosedPolicy::not_equal

    MediaPermissionRequest

    pub(all) struct MediaPermissionRequest {
    origin : String
    permissions : Int
    } derive(Eq,
    Debug
    )

    MediaPermissionRequest::equal

    MediaPermissionRequest::not_equal

    pub struct Menu {
    label : String?
    role : MenuRole?
    items : Array[MenuItem]?
    }

    A top-level native menu and its items.
    fn Menu::Menu(label : String, items~ : Array[MenuItem]) -> Menu

    fn Menu::popup(self : Menu, window : WindowHandle, x : Int, y : Int) -> Unit raise WindowSessionError

    Pops up this menu as a window-level context menu at view-relative coordinates (top-left origin, CSS pixels) inside window. Command items deliver through the same menu.command event path as the application menu bar; role items invoke their platform-native actions.
    fn Menu::role(role : MenuRole, label? : String, items? : Array[MenuItem]) -> Menu

    Creates a standard top-level menu. Omitted items select the role defaults; an explicit item array replaces those defaults exactly.
    pub struct MenuBar {
    menus : Array[Menu]
    }

    An application-level native menu bar.
    fn MenuBar::MenuBar(menus~ : Array[Menu]) -> MenuBar

    pub struct MenuItem {
    kind : Int
    id : String?
    label : String?
    key : String?
    role : MenuItemRole?
    submenu : Menu?
    enabled : Bool
    visible : Bool
    checked : Bool?
    }

    A command, separator, or platform role in a native application menu.
    fn MenuItem::command(id : String, label : String, key? : String, enabled? : Bool, visible? : Bool, checked? : Bool) -> MenuItem

    Creates a command item. enabled and visible control native presentation. Passing checked creates a checkbox command item; omitting it creates a normal command item.
    fn MenuItem::role(role : MenuItemRole, label? : String, key? : String) -> MenuItem

    fn MenuItem::separator() -> MenuItem

    fn MenuItem::submenu(label : String, items~ : Array[MenuItem]) -> MenuItem

    Creates a nested submenu item with its own set of items.
    pub(all) enum MenuItemRole {
    Quit
    Hide
    HideOthers
    ShowAll
    Close
    Minimize
    Zoom
    Undo
    Redo
    Cut
    Copy
    Paste
    SelectAll
    } derive(Eq,
    Debug
    )

    A standard native menu action.

    fn MenuItemRole::not_equal(x : MenuItemRole, y : MenuItemRole) -> Bool

    pub(all) enum MenuRole {
    Application
    File
    Edit
    View
    Window
    Help
    } derive(Eq,
    Debug
    )

    A standard top-level application menu role.
    fn MenuRole::equal(MenuRole, MenuRole) -> Bool

    fn MenuRole::not_equal(x : MenuRole, y : MenuRole) -> Bool

    NativeImage

    An Electron-style native image with one or more scale representations.

    NativeImage::add_bitmap

    fn NativeImage::add_bitmap(self : NativeImage, data : Bytes, width : Int, height : Int, scale_factor? : Double) -> Unit raise NativeImageError

    Adds a raw 32-bit RGBA bitmap representation.

    NativeImage::add_jpeg

    fn NativeImage::add_jpeg(self : NativeImage, data : Bytes, scale_factor? : Double) -> Unit raise NativeImageError

    Adds a JPEG representation at the requested scale factor.

    NativeImage::add_png

    fn NativeImage::add_png(self : NativeImage, data : Bytes, scale_factor? : Double) -> Unit raise NativeImageError

    Adds a PNG representation at the requested scale factor.

    NativeImage::destroy

    fn NativeImage::destroy(self : NativeImage) -> Unit raise NativeImageError

    Releases the native image. Calling this method more than once is safe.

    NativeImage::is_empty

    fn NativeImage::is_empty(self : NativeImage) -> Bool raise NativeImageError

    Returns whether the image has no representations.

    NativeImage::size

    fn NativeImage::size(self : NativeImage) -> (Int, Int) raise NativeImageError

    Returns the density-independent image size as (width, height).

    NativeImage::to_bitmap

    fn NativeImage::to_bitmap(self : NativeImage, scale_factor? : Double) -> (Bytes, Int, Int) raise NativeImageError

    Exports the closest representation as raw 32-bit RGBA bytes.

    NativeImage::to_jpeg

    fn NativeImage::to_jpeg(self : NativeImage, scale_factor? : Double, quality? : Int) -> (Bytes, Int, Int) raise NativeImageError

    Exports the closest representation as JPEG bytes and pixel dimensions.

    NativeImage::to_png

    fn NativeImage::to_png(self : NativeImage, scale_factor? : Double, with_transparency? : Bool) -> (Bytes, Int, Int) raise NativeImageError

    Exports the closest representation as PNG bytes and pixel dimensions.

    NativeTheme

    pub(all) struct NativeTheme {
    dark_colors : Bool
    high_contrast_colors : Bool
    source : WindowThemePreference
    }

    Describes the operating system appearance reported by the native theme query.

    NativeTheme::should_use_dark_colors

    fn NativeTheme::should_use_dark_colors(self : NativeTheme) -> Bool

    NativeTheme::should_use_high_contrast_colors

    fn NativeTheme::should_use_high_contrast_colors(self : NativeTheme) -> Bool

    NativeTheme::theme_source

    fn NativeTheme::theme_source(self : NativeTheme) -> WindowThemePreference

    Reports the application theme source that drives the snapshot, matching Electron's nativeTheme.themeSource.
    pub(all) enum NavigationDecision {
    Allow
    Deny
    } derive(Eq,
    Debug
    )

    pub(all) struct NavigationRequest {
    url : String
    http_method : String
    user_gesture : Bool
    redirect : Bool
    } derive(Eq,
    Debug
    )

    fn NavigationRequest::not_equal(x : NavigationRequest, y : NavigationRequest) -> Bool

    NewWindowDecision

    pub(all) enum NewWindowDecision {
    Deny
    OpenInCurrent
    OpenInWindow(String)
    } derive(Eq,
    Debug
    )

    NewWindowDecision::equal

    NewWindowDecision::not_equal

    fn NewWindowDecision::not_equal(x : NewWindowDecision, y : NewWindowDecision) -> Bool

    NewWindowRequest

    pub(all) struct NewWindowRequest {
    url : String
    user_gesture : Bool
    } derive(Eq,
    Debug
    )

    NewWindowRequest::equal

    NewWindowRequest::not_equal

    fn NewWindowRequest::not_equal(x : NewWindowRequest, y : NewWindowRequest) -> Bool

    PdfPrintMargins

    pub(all) enum PdfPrintMargins {
    Default
    NoMargins
    Custom(top~ : Double, right~ : Double, bottom~ : Double, left~ : Double)
    } derive(Eq,
    Debug
    )

    Margins used when printing browser contents to PDF.

    PdfPrintMargins::equal

    PdfPrintMargins::not_equal

    fn PdfPrintMargins::not_equal(x : PdfPrintMargins, y : PdfPrintMargins) -> Bool

    PdfPrintOptions

    pub(all) struct PdfPrintOptions {
    landscape : Bool
    print_background : Bool
    scale : Double
    paper_width : Double
    paper_height : Double
    prefer_css_page_size : Bool
    margins : PdfPrintMargins
    page_ranges : String
    display_header_footer : Bool
    header_template : String
    footer_template : String
    generate_tagged_pdf : Bool
    generate_document_outline : Bool
    } derive(Eq,
    Debug
    )

    Electron-style PDF print settings. Paper dimensions and custom margins use inches, and scale must be between 0.1 and 2.0. An empty page range prints the complete document.

    PdfPrintOptions::PdfPrintOptions

    fn PdfPrintOptions::PdfPrintOptions(landscape? : Bool, print_background? : Bool, scale? : Double, paper_width? : Double, paper_height? : Double, prefer_css_page_size? : Bool, margins? : PdfPrintMargins, page_ranges? : String, display_header_footer? : Bool, header_template? : String, footer_template? : String, generate_tagged_pdf? : Bool, generate_document_outline? : Bool) -> PdfPrintOptions

    PdfPrintOptions::equal

    PdfPrintOptions::not_equal

    fn PdfPrintOptions::not_equal(x : PdfPrintOptions, y : PdfPrintOptions) -> Bool

    PdfPrintResult

    pub(all) struct PdfPrintResult {
    request_id : Int
    path : String
    success : Bool
    } derive(Eq,
    Debug
    )

    Completion of one print_to_pdf request.

    PdfPrintResult::equal

    PdfPrintResult::not_equal

    fn PdfPrintResult::not_equal(x : PdfPrintResult, y : PdfPrintResult) -> Bool

    PendingUpdate

    pub struct PendingUpdate {
    version : String
    revision : UInt64
    notes_url : String?
    size : Int64
    channel :
    UpdateChannel

    offer :
    AvailableUpdate

    }

    An update the channel offered, and the means to take it.

    Being handed one means the manifest was signed by a trusted key, is fresh, and carries a revision newer than the installed one. Nothing has been downloaded.

    PendingUpdate::install

    async fn PendingUpdate::install(self : PendingUpdate, on_progress? : async (Int64) -> Unit noraise) -> UpdateInstallOutcome

    Downloads this update and prepares or applies its platform replacement.

    Downloaded chunks are written only to a private native stage while their size, digest, and signature are checked. The stage cannot be consumed unless that authentication completes. macOS and Linux replace the installed artifact here. Windows keeps the verified NSIS installer locked until restart, because the running process cannot replace its own install tree. The application is not restarted — see restart.

    This is deliberately not something the framework does on its own. Checking without being asked is a reasonable default; installing without being asked changes the code someone is running, and only the application knows whether this is a moment when that is acceptable.

    PendingUpdate::notes_url

    fn PendingUpdate::notes_url(self : PendingUpdate) -> String?

    Where the release notes for it live, when the manifest says.

    PendingUpdate::restart

    fn PendingUpdate::restart(_self : PendingUpdate) -> Unit raise

    Starts the installed replacement. The caller should exit afterwards.

    Returning without an error means the system accepted the request, not that the new version is running: it decides that afterwards and does not report back.

    PendingUpdate::revision

    fn PendingUpdate::revision(self : PendingUpdate) -> UInt64

    The signed monotonic release order.

    PendingUpdate::size

    fn PendingUpdate::size(self : PendingUpdate) -> Int64

    How many bytes taking it will transfer.

    PendingUpdate::version

    fn PendingUpdate::version(self : PendingUpdate) -> String

    The version on offer.

    PermissionRequest

    pub(all) enum PermissionRequest {
    Certificate(CertificateError)
    Media(MediaPermissionRequest)
    } derive(Eq,
    Debug
    )

    A browser permission request delivered to the unified policy handler.

    PermissionRequest::equal

    PermissionRequest::not_equal

    fn PermissionRequest::not_equal(x : PermissionRequest, y : PermissionRequest) -> Bool

    ProgressBarMode

    pub(all) enum ProgressBarMode {
    Automatic
    Normal
    Indeterminate
    Error
    Paused
    Cleared
    } derive(Eq,
    Debug
    )

    Explicit progress states for WindowHandle::set_progress_bar, mirroring Electron's mode option. Only Windows renders the explicit states; macOS and Linux derive the indicator from the progress value alone.

    ProgressBarMode::equal

    ProgressBarMode::not_equal

    fn ProgressBarMode::not_equal(x : ProgressBarMode, y : ProgressBarMode) -> Bool

    RelaunchOptions

    pub(all) struct RelaunchOptions {
    executable : String?
    arguments : Array[String]?
    } derive(Eq,
    Debug
    )

    Optional command override for ApplicationContext::relaunch.

    With neither field set, Proton repeats the current executable and command line. Setting either field switches to Electron's override behavior: the executable still defaults to the current executable, while omitted arguments become an empty array.

    RelaunchOptions::RelaunchOptions

    fn RelaunchOptions::RelaunchOptions(executable? : String, arguments? : Array[String]) -> RelaunchOptions

    RelaunchOptions::equal

    RelaunchOptions::not_equal

    fn RelaunchOptions::not_equal(x : RelaunchOptions, y : RelaunchOptions) -> Bool

    RendererTarget

    pub struct RendererTarget {
    window : String
    bundled : Bool
    }

    Identifies one renderer page that may use a capability.

    RendererTarget::bundled

    fn RendererTarget::bundled(window? : String) -> RendererTarget

    Selects Proton's bundled application origin in one window as a renderer capability target.

    RendererTarget::entry

    fn RendererTarget::entry(window? : String) -> RendererTarget

    Selects a window's configured entry as a renderer capability target.

    RuntimeLaunchInput

    pub(all) enum RuntimeLaunchInput {
    OpenUrls(Array[String])
    OpenFiles(Array[String])
    Reopen
    } derive(Eq,
    Debug
    )

    An operating-system request delivered to an already running application.

    RuntimeLaunchInput::equal

    RuntimeLaunchInput::not_equal

    ScreenInfo

    pub(all) struct ScreenInfo {
    id : Int
    x : Int
    y : Int
    width : Int
    height : Int
    work_x : Int
    work_y : Int
    work_width : Int
    work_height : Int
    scale_factor_percent : Int
    is_primary : Bool
    } derive(Eq,
    Debug
    )

    Information about one connected display.

    ScreenInfo::equal

    fn ScreenInfo::equal(ScreenInfo, ScreenInfo) -> Bool

    ScreenInfo::not_equal

    fn ScreenInfo::not_equal(x : ScreenInfo, y : ScreenInfo) -> Bool

    SessionHandle

    pub struct SessionHandle {
    id : String
    native_id : Int64
    read_cookies : async (String?, Bool) -> Array[Cookie] raise WindowSessionError
    write_cookie : (String, String, String, String?, String?, Bool, Bool, CookieSameSite) -> Unit raise WindowSessionError
    remove_cookies : (String?, String?) -> Unit raise WindowSessionError
    flush_cookie_store : () -> Unit raise WindowSessionError
    clear_http_cache : () -> Unit raise WindowSessionError
    clear_http_auth_cache : () -> Unit raise WindowSessionError
    clear_certificate_exceptions : () -> Unit raise WindowSessionError
    close_all_connections : () -> Unit raise WindowSessionError
    clear_storage_data : (StorageDataKind) -> Unit raise WindowSessionError
    }

    A non-owning reference to the request context used by one window's main browser, corresponding to Electron's webContents.session.

    SessionHandle::clear_auth_cache

    fn SessionHandle::clear_auth_cache(self : SessionHandle) -> Unit raise WindowSessionError

    Clears cached HTTP authentication credentials for this session.

    SessionHandle::clear_cache

    fn SessionHandle::clear_cache(self : SessionHandle) -> Unit raise WindowSessionError

    Clears the session's HTTP cache.

    SessionHandle::clear_certificate_exceptions

    fn SessionHandle::clear_certificate_exceptions(self : SessionHandle) -> Unit raise WindowSessionError

    Clears stored certificate exception decisions for this session.

    SessionHandle::clear_storage_data

    fn SessionHandle::clear_storage_data(self : SessionHandle, kind : StorageDataKind) -> Unit raise WindowSessionError

    Clears the selected live session storage categories.

    SessionHandle::close_all_connections

    fn SessionHandle::close_all_connections(self : SessionHandle) -> Unit raise WindowSessionError

    Closes active and idle Chromium network connections for this session.

    SessionHandle::delete_cookies

    fn SessionHandle::delete_cookies(self : SessionHandle, url? : String, name? : String) -> Unit raise WindowSessionError

    Deletes matching cookies. Omitting both filters deletes all cookies.

    SessionHandle::flush_cookies

    fn SessionHandle::flush_cookies(self : SessionHandle) -> Unit raise WindowSessionError

    Flushes pending cookie changes to disk.

    SessionHandle::get_cookies

    async fn SessionHandle::get_cookies(self : SessionHandle, url? : String, include_http_only? : Bool) -> Array[Cookie] raise WindowSessionError

    Returns cookies visible to the session, optionally restricted to one URL. HTTP-only cookies are excluded unless include_http_only is true.
    fn SessionHandle::set_cookie(self : SessionHandle, url : String, name : String, value : String, domain? : String, path? : String, secure? : Bool, http_only? : Bool, same_site? : CookieSameSite) -> Unit raise WindowSessionError

    Sets a cookie in the session's cookie store.

    SessionHandle::window_id

    fn SessionHandle::window_id(self : SessionHandle) -> String

    Returns the window id whose request context owns this session.

    StorageDataKind

    pub(all) enum StorageDataKind {
    Cookies
    HttpCache
    AllSupported
    } derive(Eq,
    Debug
    )

    Selects browser storage that can be cleared from a live Proton session.

    StorageDataKind::equal

    StorageDataKind::not_equal

    fn StorageDataKind::not_equal(x : StorageDataKind, y : StorageDataKind) -> Bool

    ThumbarButton

    pub(all) struct ThumbarButton {
    id : String
    icon : NativeImage
    tooltip : String
    flags : Array[ThumbarButtonFlag]
    }

    One button of the Windows taskbar thumbnail toolbar.

    id identifies the button in App::on_thumbar_button_click, so rebuilding the toolbar never changes what a click reports. tooltip is optional text for the button, and flags controls its state.

    ThumbarButtonFlag

    pub(all) enum ThumbarButtonFlag {
    Disabled
    DismissOnClick
    NoBackground
    Hidden
    NonInteractive
    } derive(Eq,
    Debug
    )

    Taskbar thumbnail-toolbar button flags, mirroring Electron's flags array. A button is enabled unless Disabled or NonInteractive is present.

    ThumbarButtonFlag::equal

    ThumbarButtonFlag::not_equal

    fn ThumbarButtonFlag::not_equal(x : ThumbarButtonFlag, y : ThumbarButtonFlag) -> Bool

    TitlebarStyle

    pub(all) enum TitlebarStyle {
    Default
    Overlay
    } derive(Eq,
    Debug
    )

    Controls whether web content stays below or extends beneath the titlebar.

    TitlebarStyle::equal

    TitlebarStyle::not_equal

    fn TitlebarStyle::not_equal(x : TitlebarStyle, y : TitlebarStyle) -> Bool

    UpdateCheck

    pub enum UpdateCheck {
    NotConfigured
    UpToDate
    Available(PendingUpdate)
    }

    What asking the channel concluded.

    UpdateInstallOutcome

    pub enum UpdateInstallOutcome {
    Installed
    AlreadyInstalled
    } derive(Eq,
    Debug
    )

    What applying an update changed.

    UpdateInstallOutcome::equal

    UpdateInstallOutcome::not_equal

    ViewConfig

    pub struct ViewConfig {
    x : Int
    y : Int
    width : Int
    height : Int
    visible : Bool
    z_order : Int
    initial_url : String
    background_color : String?
    }

    Configuration for a web contents view hosted inside a window.

    ViewConfig::ViewConfig

    fn ViewConfig::ViewConfig(width~ : Int, height~ : Int, x? : Int, y? : Int, visible? : Bool, z_order? : Int, initial_url? : String, background_color? : String) -> ViewConfig

    ViewEvent

    pub(all) enum ViewEvent {
    LoadingChanged(is_loading~ : Bool)
    DidStartLoading
    DidFinishLoad
    Navigated(url~ : String)
    TitleUpdated(title~ : String)
    LoadFailed(url~ : String, error_code~ : Int, error_text~ : String)
    RendererProcessTerminated(url~ : String, status~ : Int, error_code~ : Int, detail~ : String)
    FoundInPage(result~ : FindInPageResult)
    Closed
    } derive(Eq,
    Debug
    )

    An observed change to a running web contents view, following Electron webContents lifecycle and page-search events.

    ViewEvent::equal

    fn ViewEvent::equal(ViewEvent, ViewEvent) -> Bool

    ViewEvent::not_equal

    fn ViewEvent::not_equal(x : ViewEvent, y : ViewEvent) -> Bool

    ViewHandle

    pub struct ViewHandle {
    id : String
    native_id : Int64
    set_view_bounds : (Int, Int, Int, Int) -> Unit raise WindowSessionError
    set_view_visible : (Bool) -> Unit raise WindowSessionError
    set_view_z_order : (Int) -> Unit raise WindowSessionError
    set_view_zoom_percent : (Int) -> Unit raise WindowSessionError
    read_view_zoom_percent : () -> Int raise WindowSessionError
    set_view_audio_muted : (Bool) -> Unit raise WindowSessionError
    read_view_audio_muted : () -> Bool raise WindowSessionError
    load_view_url : (String) -> Unit raise WindowSessionError
    load_view_html : (String, String) -> Unit raise WindowSessionError
    eval_view_script : (String) -> Unit raise WindowSessionError
    focus_view : () -> Unit raise WindowSessionError
    send_view_command : (String, Int?) -> Unit raise WindowSessionError
    find_view_in_page : (String, Bool, Bool, Bool) -> Int raise WindowSessionError
    stop_view_find : (Bool) -> Unit raise WindowSessionError
    read_view_navigation_state : () -> (Bool, Bool) raise WindowSessionError
    read_view_focused : () -> Bool raise WindowSessionError
    read_view_devtools_opened : () -> Bool raise WindowSessionError
    read_view_state : () -> ViewState raise WindowSessionError
    close_view : () -> Unit raise WindowSessionError
    }

    A non-owning reference to one concrete web contents view instance.

    Views follow the Electron WebContentsView model: each view is an independent web page hosted inside its owning window's content area with explicit top-left bounds, visibility, and z-order. The instance id prevents a stale handle from targeting a later view that reuses the same declarative id.

    ViewHandle::back

    fn ViewHandle::back(self : ViewHandle) -> Unit raise WindowSessionError

    ViewHandle::can_go_back

    fn ViewHandle::can_go_back(self : ViewHandle) -> Bool raise WindowSessionError

    Returns whether the view can navigate to a previous history entry.

    ViewHandle::can_go_forward

    fn ViewHandle::can_go_forward(self : ViewHandle) -> Bool raise WindowSessionError

    Returns whether the view can navigate to a later history entry.

    ViewHandle::close

    fn ViewHandle::close(self : ViewHandle) -> Unit raise WindowSessionError

    Removes and destroys the view, the Electron removeChildView equivalent.

    ViewHandle::close_devtools

    fn ViewHandle::close_devtools(self : ViewHandle) -> Unit raise WindowSessionError

    ViewHandle::copy

    fn ViewHandle::copy(self : ViewHandle) -> Unit raise WindowSessionError

    Copies the current selection in the focused frame.

    ViewHandle::cut

    fn ViewHandle::cut(self : ViewHandle) -> Unit raise WindowSessionError

    Cuts the current selection in the focused frame.

    ViewHandle::delete

    fn ViewHandle::delete(self : ViewHandle) -> Unit raise WindowSessionError

    Deletes the current selection in the focused frame.

    ViewHandle::eval

    fn ViewHandle::eval(self : ViewHandle, script : String) -> Unit raise WindowSessionError

    Executes JavaScript in the view's main frame without awaiting a result.

    ViewHandle::find_in_page

    fn ViewHandle::find_in_page(self : ViewHandle, text : String, forward? : Bool, match_case? : Bool, find_next? : Bool) -> Int raise WindowSessionError

    Starts or advances a page search and returns its request id. Set find_next=true to begin a new search session, matching Electron's findInPage option; leave it false to advance the current session.

    ViewHandle::focus

    fn ViewHandle::focus(self : ViewHandle) -> Unit raise WindowSessionError

    Focuses this view's web page, matching Electron webContents.focus().

    ViewHandle::forward

    fn ViewHandle::forward(self : ViewHandle) -> Unit raise WindowSessionError

    ViewHandle::id

    fn ViewHandle::id(self : ViewHandle) -> String

    Returns the declarative id of this view.

    ViewHandle::is_audio_muted

    fn ViewHandle::is_audio_muted(self : ViewHandle) -> Bool raise WindowSessionError

    Returns whether audio produced by this view's page is muted.

    ViewHandle::is_devtools_opened

    fn ViewHandle::is_devtools_opened(self : ViewHandle) -> Bool raise WindowSessionError

    Returns whether this web contents currently has an open DevTools view.

    ViewHandle::is_focused

    fn ViewHandle::is_focused(self : ViewHandle) -> Bool raise WindowSessionError

    Returns whether this view's web page currently owns focus.

    ViewHandle::load_html

    fn ViewHandle::load_html(self : ViewHandle, html : String, base_url : String) -> Unit raise WindowSessionError

    Loads inline HTML into the view, served from base_url on the proton:// scheme, mirroring WindowHandle::load_html.

    ViewHandle::load_url

    fn ViewHandle::load_url(self : ViewHandle, url : String) -> Unit raise WindowSessionError

    Navigates the view's page, the Electron view.webContents.loadURL equivalent.

    ViewHandle::open_devtools

    fn ViewHandle::open_devtools(self : ViewHandle) -> Unit raise WindowSessionError

    ViewHandle::paste

    fn ViewHandle::paste(self : ViewHandle) -> Unit raise WindowSessionError

    Pastes clipboard contents into the focused frame.

    ViewHandle::paste_and_match_style

    fn ViewHandle::paste_and_match_style(self : ViewHandle) -> Unit raise WindowSessionError

    Pastes clipboard contents using the destination's current style.

    ViewHandle::redo

    fn ViewHandle::redo(self : ViewHandle) -> Unit raise WindowSessionError

    Redoes the most recently undone edit in the focused frame.

    ViewHandle::reload

    fn ViewHandle::reload(self : ViewHandle, ignore_cache? : Bool) -> Unit raise WindowSessionError

    ViewHandle::select_all

    fn ViewHandle::select_all(self : ViewHandle) -> Unit raise WindowSessionError

    Selects all editable content in the focused frame.

    ViewHandle::set_audio_muted

    fn ViewHandle::set_audio_muted(self : ViewHandle, muted : Bool) -> Unit raise WindowSessionError

    Mutes or unmutes audio produced by this view's page.

    ViewHandle::set_bounds

    fn ViewHandle::set_bounds(self : ViewHandle, x~ : Int, y~ : Int, width~ : Int, height~ : Int) -> Unit raise WindowSessionError

    Moves and resizes the view. x/y use a top-left origin in the owning window's content coordinate space, matching Electron's setBounds.

    ViewHandle::set_visible

    fn ViewHandle::set_visible(self : ViewHandle, visible : Bool) -> Unit raise WindowSessionError

    ViewHandle::set_z_order

    fn ViewHandle::set_z_order(self : ViewHandle, z_order : Int) -> Unit raise WindowSessionError

    Stacks the view relative to the window's other views; higher z_order renders above lower values.

    ViewHandle::set_zoom_percent

    fn ViewHandle::set_zoom_percent(self : ViewHandle, zoom_percent : Int) -> Unit raise WindowSessionError

    Sets this view's browser zoom from 25% through 500%.

    ViewHandle::state

    Reads the current view state from the native runtime.

    ViewHandle::stop

    fn ViewHandle::stop(self : ViewHandle) -> Unit raise WindowSessionError

    ViewHandle::stop_find_in_page

    fn ViewHandle::stop_find_in_page(self : ViewHandle, clear_selection? : Bool) -> Unit raise WindowSessionError

    Stops the active page search. Set clear_selection=false to preserve the current match highlight.

    ViewHandle::toggle_devtools

    fn ViewHandle::toggle_devtools(self : ViewHandle) -> Unit raise WindowSessionError

    Toggles the DevTools view for this web contents.

    ViewHandle::undo

    fn ViewHandle::undo(self : ViewHandle) -> Unit raise WindowSessionError

    Undoes the most recent edit in the focused frame.

    ViewHandle::zoom_percent

    fn ViewHandle::zoom_percent(self : ViewHandle) -> Int raise WindowSessionError

    Returns this view's browser zoom percentage.

    ViewState

    pub(all) struct ViewState {
    x : Int
    y : Int
    width : Int
    height : Int
    visible : Bool
    z_order : Int
    } derive(Eq,
    Debug
    )

    A point-in-time web contents view state snapshot.

    ViewState::equal

    fn ViewState::equal(ViewState, ViewState) -> Bool

    ViewState::not_equal

    fn ViewState::not_equal(x : ViewState, y : ViewState) -> Bool

    WindowCloseDecision

    pub(all) enum WindowCloseDecision {
    Allow
    Deny
    } derive(Eq,
    Debug
    )

    The result of an asynchronous native close request.

    WindowCloseDecision::equal

    WindowCloseDecision::not_equal

    WindowContext

    pub struct WindowContext {
    id : String
    handle : WindowHandle
    windows : WindowManager
    tasks :
    TaskGroup
    [Unit]
    events : WindowEventEmitter
    locale_preferences :
    LocalePreferences

    }

    Window-lifetime capabilities supplied to window startup hooks.

    WindowContext::events

    Returns an event emitter bound to this window's active page.

    WindowContext::handle

    Returns the session-controlled handle for this concrete window instance.

    WindowContext::id

    fn WindowContext::id(self : WindowContext) -> String

    Returns the declarative id of this window. The primary window uses "main".

    WindowContext::locale

    Returns the immutable application locale selected at startup.

    WindowContext::preferred_languages

    Returns the application's ordered language preferences.

    WindowContext::task_group

    Returns the structured task group owned by this window.

    WindowContext::windows

    Returns the application window manager.

    WindowEvent

    pub(all) enum WindowEvent {
    StateChanged(WindowState)
    Closed
    ReadyToShow
    Moved
    Resized
    Show
    Hide
    Focus
    Blur
    Minimize
    Restore
    Maximize
    Unmaximize
    EnterFullScreen
    LeaveFullScreen
    } derive(Eq,
    Debug
    )

    An observed change to a running native window.

    WindowEvent::equal

    fn WindowEvent::equal(WindowEvent, WindowEvent) -> Bool

    WindowEvent::not_equal

    fn WindowEvent::not_equal(x : WindowEvent, y : WindowEvent) -> Bool

    WindowEventEmitter

    pub struct WindowEventEmitter {
    emit_event : async (
    ContractRoute
    , String, Json) -> Unit noraise
    }

    A typed event destination bound to one explicit window.

    WindowEventEmitter::emit

    async fn[Payload : ToJson] WindowEventEmitter::emit(self : WindowEventEmitter, event :
    Event
    [Payload], payload : Payload) -> Unit

    Emits a typed event to this emitter's window.

    WindowHandle

    pub struct WindowHandle {
    id : String
    native_id : Int64
    show_window : () -> Unit raise WindowSessionError
    show_window_inactive : () -> Unit raise WindowSessionError
    hide_window : () -> Unit raise WindowSessionError
    close_window : () -> Unit raise WindowSessionError
    focus_window : () -> Unit raise WindowSessionError
    set_window_title : (String) -> Unit raise WindowSessionError
    set_window_icon : (String) -> Unit raise WindowSessionError
    set_window_parent : (WindowHandle?, Bool) -> Unit raise WindowSessionError
    set_window_size : (Int, Int) -> Unit raise WindowSessionError
    set_window_content_size : (Int, Int) -> Unit raise WindowSessionError
    read_window_content_size : () -> (Int, Int) raise WindowSessionError
    minimize_window : () -> Unit raise WindowSessionError
    maximize_window : () -> Unit raise WindowSessionError
    restore_window : () -> Unit raise WindowSessionError
    set_window_fullscreen : (Bool) -> Unit raise WindowSessionError
    set_window_kiosk : (Bool) -> Unit raise WindowSessionError
    set_window_position : (Int, Int) -> Unit raise WindowSessionError
    set_window_always_on_top : (Bool) -> Unit raise WindowSessionError
    set_window_resizable : (Bool) -> Unit raise WindowSessionError
    set_window_minimum_size : (Int, Int) -> Unit raise WindowSessionError
    set_window_maximum_size : (Int, Int) -> Unit raise WindowSessionError
    set_window_aspect_ratio : (Double) -> Unit raise WindowSessionError
    set_window_movable : (Bool) -> Unit raise WindowSessionError
    set_window_opacity : (Double) -> Unit raise WindowSessionError
    set_window_skip_taskbar : (Bool) -> Unit raise WindowSessionError
    set_window_content_protection : (Bool) -> Unit raise WindowSessionError
    set_window_minimizable : (Bool) -> Unit raise WindowSessionError
    set_window_maximizable : (Bool) -> Unit raise WindowSessionError
    set_window_closable : (Bool) -> Unit raise WindowSessionError
    set_window_button_visibility : (Bool) -> Unit raise WindowSessionError
    set_window_focusable : (Bool) -> Unit raise WindowSessionError
    set_window_fullscreenable : (Bool) -> Unit raise WindowSessionError
    set_window_has_shadow : (Bool) -> Unit raise WindowSessionError
    set_window_ignore_mouse_events : (Bool, Bool) -> Unit raise WindowSessionError
    set_window_background_color : (String) -> Unit raise WindowSessionError
    set_window_theme : (WindowThemePreference) -> Unit raise WindowSessionError
    set_window_visible_on_all_workspaces : (Bool) -> Unit raise WindowSessionError
    set_window_enabled : (Bool) -> Unit raise WindowSessionError
    set_window_menu : (MenuBar?) -> Unit raise WindowSessionError
    set_window_zoom_percent : (Int) -> Unit raise WindowSessionError
    set_window_progress_bar : (Double, ProgressBarMode) -> Unit raise WindowSessionError
    set_window_overlay_icon : (
    NativeImage
    ?, String) -> Unit raise WindowSessionError
    set_window_thumbnail_tooltip : (String) -> Unit raise WindowSessionError
    set_window_thumbar_buttons : (Array[
    ThumbarButton
    ]) -> Bool raise WindowSessionError
    flash_window_frame : (Bool) -> Unit raise WindowSessionError
    popup_window_menu : (Menu, Int, Int) -> Unit raise WindowSessionError
    read_window_state : () -> WindowState raise WindowSessionError
    browser : BrowserHandle
    add_view : (String, ViewConfig) -> ViewHandle raise WindowSessionError
    remove_view : (String) -> Unit raise WindowSessionError
    list_views : () -> Array[ViewHandle]
    find_view : (String) -> ViewHandle?
    }

    A non-owning reference to one concrete window instance.

    The instance id prevents a stale handle from targeting a later window that reuses the same declarative id.

    WindowHandle::add_view

    fn WindowHandle::add_view(self : WindowHandle, id : String, config : ViewConfig) -> ViewHandle raise WindowSessionError

    Adds a web contents view to this window, following the Electron WebContentsView model: the view renders its own page above the window's main browser content at explicit bounds. id is unique within the window and lets the session reject stale handles.

    WindowHandle::bounds

    fn WindowHandle::bounds(self : WindowHandle) -> (Int, Int, Int, Int) raise WindowSessionError

    Returns (x, y, width, height) in logical screen pixels, matching Electron's getBounds coordinate order.

    WindowHandle::browser

    fn WindowHandle::browser(self : WindowHandle) -> BrowserHandle

    WindowHandle::center

    fn WindowHandle::center(self : WindowHandle) -> Unit raise WindowSessionError

    Centers the window in the work area of the monitor containing it.

    The current native frame size is preserved. Work-area coordinates exclude taskbars, docks, and other reserved desktop regions, and use Proton's top-left coordinate convention on every platform.

    WindowHandle::close

    fn WindowHandle::close(self : WindowHandle) -> Unit raise WindowSessionError

    WindowHandle::content_size

    fn WindowHandle::content_size(self : WindowHandle) -> (Int, Int) raise WindowSessionError

    Returns the renderer content area in logical pixels.

    WindowHandle::flash_frame

    fn WindowHandle::flash_frame(self : WindowHandle, flash : Bool) -> Unit raise WindowSessionError

    Starts or stops flashing the window to attract the user's attention.

    On macOS, true continuously bounces the application Dock icon until the application becomes active or flash_frame(false) cancels the request. On Windows it flashes the taskbar button until the window becomes active, and on Linux it sets the desktop window urgency hint. Headless runtimes raise WindowSessionError.

    WindowHandle::focus

    fn WindowHandle::focus(self : WindowHandle) -> Unit raise WindowSessionError

    WindowHandle::hide

    fn WindowHandle::hide(self : WindowHandle) -> Unit raise WindowSessionError

    WindowHandle::id

    fn WindowHandle::id(self : WindowHandle) -> String

    Returns the declarative id of this window.

    WindowHandle::is_always_on_top

    fn WindowHandle::is_always_on_top(self : WindowHandle) -> Bool raise WindowSessionError

    Reports whether the window is currently kept above other windows.

    WindowHandle::is_focused

    fn WindowHandle::is_focused(self : WindowHandle) -> Bool raise WindowSessionError

    WindowHandle::is_fullscreen

    fn WindowHandle::is_fullscreen(self : WindowHandle) -> Bool raise WindowSessionError

    Reports whether the window is currently fullscreen.

    WindowHandle::is_maximized

    fn WindowHandle::is_maximized(self : WindowHandle) -> Bool raise WindowSessionError

    Reports whether the window is currently maximized.

    WindowHandle::is_minimized

    fn WindowHandle::is_minimized(self : WindowHandle) -> Bool raise WindowSessionError

    Reports whether the window is currently minimized.

    WindowHandle::is_visible

    fn WindowHandle::is_visible(self : WindowHandle) -> Bool raise WindowSessionError

    WindowHandle::maximize

    fn WindowHandle::maximize(self : WindowHandle) -> Unit raise WindowSessionError

    WindowHandle::minimize

    fn WindowHandle::minimize(self : WindowHandle) -> Unit raise WindowSessionError

    WindowHandle::position

    fn WindowHandle::position(self : WindowHandle) -> (Int, Int) raise WindowSessionError

    Returns the window's (x, y) position in logical screen pixels.

    WindowHandle::remove_view

    fn WindowHandle::remove_view(self : WindowHandle, id : String) -> Unit raise WindowSessionError

    Removes and destroys a web contents view previously added with add_view.

    WindowHandle::restore

    fn WindowHandle::restore(self : WindowHandle) -> Unit raise WindowSessionError

    WindowHandle::set_always_on_top

    fn WindowHandle::set_always_on_top(self : WindowHandle, always_on_top : Bool) -> Unit raise WindowSessionError

    WindowHandle::set_aspect_ratio

    fn WindowHandle::set_aspect_ratio(self : WindowHandle, aspect_ratio : Double) -> Unit raise WindowSessionError

    Sets the live native window aspect ratio used while the user resizes it. Pass 0.0 to clear the constraint. Programmatic set_size calls are not constrained by the ratio, matching Electron's setAspectRatio behavior. Headless runtimes raise WindowSessionError.

    WindowHandle::set_background_color

    fn WindowHandle::set_background_color(self : WindowHandle, color : String) -> Unit raise WindowSessionError

    Sets the live native window background color.

    Accepts #RRGGBB or #AARRGGBB, matching Proton view configuration.

    WindowHandle::set_bounds

    fn WindowHandle::set_bounds(self : WindowHandle, x~ : Int, y~ : Int, width~ : Int, height~ : Int) -> Unit raise WindowSessionError

    Sets (x, y, width, height) in logical screen pixels, matching Electron's setBounds coordinate order.

    WindowHandle::set_closable

    fn WindowHandle::set_closable(self : WindowHandle, closable : Bool) -> Unit raise WindowSessionError

    Sets whether the user can manually close this live native window.

    macOS and Windows update the native close control; programmatic close calls remain available. Linux follows Electron and treats this as a successful no-op. Headless runtimes raise WindowSessionError.

    WindowHandle::set_content_protection

    fn WindowHandle::set_content_protection(self : WindowHandle, enabled : Bool) -> Unit raise WindowSessionError

    Sets whether other applications should be prevented from capturing this live native window.

    macOS applies NSWindowSharingNone, although ScreenCaptureKit-based apps on recent macOS releases may still capture the window. Windows uses display affinity to exclude the window from capture. Linux follows Electron and treats this as a no-op. Headless runtimes raise WindowSessionError.

    WindowHandle::set_content_size

    fn WindowHandle::set_content_size(self : WindowHandle, width : Int, height : Int) -> Unit raise WindowSessionError

    Sets the renderer content area in logical pixels.

    WindowHandle::set_enabled

    fn WindowHandle::set_enabled(self : WindowHandle, enabled : Bool) -> Unit raise WindowSessionError

    Enables or disables user interaction with the live native window.

    WindowHandle::set_focusable

    fn WindowHandle::set_focusable(self : WindowHandle, focusable : Bool) -> Unit raise WindowSessionError

    Sets whether this live native window can receive focus.

    macOS and Windows update the native window behavior. On macOS, disabling focus does not remove focus from a window that is already focused, matching Electron. Linux follows Electron and treats this as a successful no-op. Headless runtimes raise WindowSessionError.

    WindowHandle::set_fullscreen

    fn WindowHandle::set_fullscreen(self : WindowHandle, fullscreen : Bool) -> Unit raise WindowSessionError

    WindowHandle::set_fullscreenable

    fn WindowHandle::set_fullscreenable(self : WindowHandle, fullscreenable : Bool) -> Unit raise WindowSessionError

    Sets whether this live native window can enter fullscreen mode.

    When disabled, attempts to enter fullscreen are ignored. An already fullscreen window can still exit fullscreen.

    WindowHandle::set_has_shadow

    fn WindowHandle::set_has_shadow(self : WindowHandle, has_shadow : Bool) -> Unit raise WindowSessionError

    Sets whether this live native window draws a frame shadow.

    macOS applies this directly to the native window. Linux and Windows accept the setting as a successful no-op when the platform frame owns the shadow. Headless runtimes raise WindowSessionError.

    WindowHandle::set_icon

    fn WindowHandle::set_icon(self : WindowHandle, path : String) -> Unit raise WindowSessionError

    Sets the native window icon from an image file path.

    WindowHandle::set_ignore_mouse_events

    fn WindowHandle::set_ignore_mouse_events(self : WindowHandle, ignore : Bool, forward : Bool) -> Unit raise WindowSessionError

    Sets whether this live native window ignores mouse events.

    When ignore is true, mouse input passes through to the window below while keyboard input remains available to the focused window. forward requests mouse-move forwarding to Chromium where the platform supports it. Forwarding is disabled automatically when ignore is false.

    WindowHandle::set_kiosk

    fn WindowHandle::set_kiosk(self : WindowHandle, kiosk : Bool) -> Unit raise WindowSessionError

    Enters or leaves kiosk mode.

    Kiosk uses the full display and hides system chrome where the platform supports it. Call with false to provide a programmatic exit path.

    WindowHandle::set_maximizable

    fn WindowHandle::set_maximizable(self : WindowHandle, maximizable : Bool) -> Unit raise WindowSessionError

    Sets whether the user can manually maximize this live native window. macOS and Windows update the native maximize/zoom control; Linux follows Electron and treats this as a successful no-op. Headless runtimes raise WindowSessionError.

    WindowHandle::set_maximum_size

    fn WindowHandle::set_maximum_size(self : WindowHandle, width : Int, height : Int) -> Unit raise WindowSessionError

    Sets the maximum live native window size.

    Both dimensions must be positive, or both must be zero to clear the constraint. Existing minimum size and resizable state remain unchanged. Headless runtimes raise WindowSessionError.

    WindowHandle::set_menu

    fn WindowHandle::set_menu(self : WindowHandle, menu : MenuBar?) -> Unit raise WindowSessionError

    Replaces the native menu for the application runtime containing this window. Passing None clears the menu.

    WindowHandle::set_minimizable

    fn WindowHandle::set_minimizable(self : WindowHandle, minimizable : Bool) -> Unit raise WindowSessionError

    Sets whether the user can manually minimize this live native window. macOS and Windows update the native minimize control; Linux follows Electron and treats this as a successful no-op. Headless runtimes raise WindowSessionError.

    WindowHandle::set_minimum_size

    fn WindowHandle::set_minimum_size(self : WindowHandle, width : Int, height : Int) -> Unit raise WindowSessionError

    Sets the minimum live native window size.

    Both dimensions must be positive, or both must be zero to clear the constraint. Existing maximum size and resizable state remain unchanged. Headless runtimes raise WindowSessionError.

    WindowHandle::set_movable

    fn WindowHandle::set_movable(self : WindowHandle, movable : Bool) -> Unit raise WindowSessionError

    Sets whether the user can move this live native window.

    macOS and Windows prevent manual frame movement when movable is false; programmatic set_position and center calls remain available. Linux follows Electron and treats this as a no-op. Headless runtimes raise WindowSessionError because they have no native frame.

    WindowHandle::set_opacity

    fn WindowHandle::set_opacity(self : WindowHandle, opacity : Double) -> Unit raise WindowSessionError

    Sets the live native window opacity.

    Values are clamped to the Electron-compatible 0.0..1.0 range, where 0.0 is fully transparent and 1.0 is fully opaque. Headless runtimes raise WindowSessionError because they have no native frame.

    WindowHandle::set_overlay_icon

    fn WindowHandle::set_overlay_icon(self : WindowHandle, overlay : NativeImage?, description : String) -> Unit raise WindowSessionError

    Sets or clears the taskbar overlay icon shown in the bottom right of the window's taskbar button.

    Pass None to clear the overlay. description is read by accessibility screen readers. Windows scales the image to the 16x16 overlay area, keeps the aspect ratio, and clips it to a circle; other platforms accept the call and do nothing, matching Electron.

    WindowHandle::set_parent

    fn WindowHandle::set_parent(self : WindowHandle, parent : WindowHandle?, modal? : Bool) -> Unit raise WindowSessionError

    Establishes or clears this window's native parent relationship.

    WindowHandle::set_position

    fn WindowHandle::set_position(self : WindowHandle, x : Int, y : Int) -> Unit raise WindowSessionError

    WindowHandle::set_progress_bar

    fn WindowHandle::set_progress_bar(self : WindowHandle, progress : Double, mode? : ProgressBarMode) -> Unit raise WindowSessionError

    Sets the platform progress indicator using Electron-compatible values.

    Pass a negative value to clear the indicator, a value from 0.0 through 1.0 for determinate progress, or a value above 1.0 for indeterminate progress. mode mirrors Electron's mode option and selects an explicit state instead; only Windows renders it.

    macOS displays this in the Dock as one application-level indicator, so the most recent window call wins and any negative value clears it. Windows displays it on the taskbar button, where the error and paused states keep showing the value. Linux has no implementation and raises WindowSessionError.

    WindowHandle::set_resizable

    fn WindowHandle::set_resizable(self : WindowHandle, resizable : Bool) -> Unit raise WindowSessionError

    Sets whether the user can manually resize this window.

    This changes the live native window on macOS, Windows, and Linux. Existing minimum or maximum size hints remain in effect. Headless runtimes raise WindowSessionError.

    WindowHandle::set_size

    fn WindowHandle::set_size(self : WindowHandle, width : Int, height : Int) -> Unit raise WindowSessionError

    WindowHandle::set_skip_taskbar

    fn WindowHandle::set_skip_taskbar(self : WindowHandle, skip : Bool) -> Unit raise WindowSessionError

    Sets whether this live native window is omitted from the taskbar or dock.

    Windows removes or restores the taskbar tab. macOS and Linux follow Electron and treat this as a no-op. Headless runtimes raise WindowSessionError because they have no native window shell.

    WindowHandle::set_theme

    fn WindowHandle::set_theme(self : WindowHandle, theme : WindowThemePreference) -> Unit raise WindowSessionError

    Sets the native window chrome theme.

    System follows platform appearance changes. Explicit Light and Dark remain stable until changed again and raise WindowSessionError on platforms without per-window native theme support.

    WindowHandle::set_thumbar_buttons

    fn WindowHandle::set_thumbar_buttons(self : WindowHandle, buttons : Array[ThumbarButton]) -> Bool raise WindowSessionError

    Replaces the taskbar thumbnail toolbar, the row of buttons shown under the window's taskbar thumbnail. Up to seven buttons are supported, and an empty array clears the buttons that were added before.

    The result reports whether the platform showed the buttons. Windows returns the taskbar result; macOS and Linux return false because Electron marks the thumbnail toolbar as Windows only. Invalid input — more than seven buttons, an empty id, or a released image — raises WindowSessionError.

    The button slots are claimed by the first successful call, which is a Windows limitation Electron documents as well: a later call can replace or hide buttons, but it cannot remove the toolbar.

    WindowHandle::set_thumbnail_tooltip

    fn WindowHandle::set_thumbnail_tooltip(self : WindowHandle, tooltip : String) -> Unit raise WindowSessionError

    Sets the tooltip shown when the pointer rests over the window's taskbar thumbnail. Only Windows displays it; other platforms accept the call and do nothing, matching Electron.

    WindowHandle::set_title

    fn WindowHandle::set_title(self : WindowHandle, title : String) -> Unit raise WindowSessionError

    WindowHandle::set_visible_on_all_workspaces

    fn WindowHandle::set_visible_on_all_workspaces(self : WindowHandle, visible : Bool) -> Unit raise WindowSessionError

    Sets whether the live window appears on every workspace.

    This maps to Spaces on macOS and sticky windows on Linux. It is a successful no-op on Windows, matching Electron.

    WindowHandle::set_window_button_visibility

    fn WindowHandle::set_window_button_visibility(self : WindowHandle, visible : Bool) -> Unit raise WindowSessionError

    Sets visibility of the standard close, minimize, and maximize buttons. On macOS this updates the native traffic-light controls. Other platforms apply the equivalent live capability controls where available.

    WindowHandle::set_zoom_percent

    fn WindowHandle::set_zoom_percent(self : WindowHandle, zoom_percent : Int) -> Unit raise WindowSessionError

    WindowHandle::show

    fn WindowHandle::show(self : WindowHandle) -> Unit raise WindowSessionError

    WindowHandle::show_inactive

    fn WindowHandle::show_inactive(self : WindowHandle) -> Unit raise WindowSessionError

    Shows the window without activating it.

    WindowHandle::size

    fn WindowHandle::size(self : WindowHandle) -> (Int, Int) raise WindowSessionError

    Returns the window's (width, height) frame size in logical pixels.

    WindowHandle::state

    WindowHandle::view

    fn WindowHandle::view(self : WindowHandle, id : String) -> ViewHandle?

    Returns the live view with the given declarative id, if one exists.

    WindowHandle::views

    Lists the live web contents views of this window.

    WindowHandle::zoom_percent

    fn WindowHandle::zoom_percent(self : WindowHandle) -> Int raise WindowSessionError

    Returns the main browser zoom percentage.

    WindowManager

    pub struct WindowManager {
    open_window : async (String) -> WindowHandle raise WindowSessionError
    find_window : (String) -> WindowHandle?
    }

    Opens and locates windows declared by the application manifest.

    WindowManager::find

    fn WindowManager::find(self : WindowManager, id : String) -> WindowHandle?

    Returns the active instance for a declared window id.

    WindowManager::open

    async fn WindowManager::open(self : WindowManager, id : String) -> WindowHandle raise WindowSessionError

    Opens one declared window that is not currently active.

    WindowMonitor

    pub(all) struct WindowMonitor {
    x : Int
    y : Int
    width : Int
    height : Int
    work_x : Int
    work_y : Int
    work_width : Int
    work_height : Int
    scale_factor_percent : Int
    } derive(Eq,
    Debug
    )

    Geometry and scaling information for the monitor containing a window.

    WindowMonitor::equal

    WindowMonitor::not_equal

    fn WindowMonitor::not_equal(x : WindowMonitor, y : WindowMonitor) -> Bool

    WindowSizeHint

    pub(all) enum WindowSizeHint {
    Unconstrained
    Fixed
    Min
    Max
    } derive(Eq,
    Debug
    )

    Controls how configured window dimensions constrain native resizing.

    WindowSizeHint::equal

    WindowSizeHint::not_equal

    fn WindowSizeHint::not_equal(x : WindowSizeHint, y : WindowSizeHint) -> Bool

    WindowState

    pub(all) struct WindowState {
    x : Int
    y : Int
    width : Int
    height : Int
    monitor : WindowMonitor
    zoom_percent : Int
    visible : Bool
    focused : Bool
    minimized : Bool
    maximized : Bool
    fullscreen : Bool
    always_on_top : Bool
    theme : WindowTheme
    } derive(Eq,
    Debug
    )

    A point-in-time snapshot of a native window.

    theme is the effective Light or Dark theme after resolving the window's configured WindowThemePreference.

    WindowState::equal

    fn WindowState::equal(WindowState, WindowState) -> Bool

    WindowState::not_equal

    fn WindowState::not_equal(x : WindowState, y : WindowState) -> Bool

    WindowTheme

    pub(all) enum WindowTheme {
    Light
    Dark
    } derive(Eq,
    Debug
    )

    Describes the effective native window chrome theme.

    WindowTheme::equal

    fn WindowTheme::equal(WindowTheme, WindowTheme) -> Bool

    WindowTheme::not_equal

    fn WindowTheme::not_equal(x : WindowTheme, y : WindowTheme) -> Bool

    WindowThemePreference

    pub(all) enum WindowThemePreference {
    System
    Light
    Dark
    } derive(Eq,
    Debug
    )

    Controls how Proton chooses the native window chrome theme.

    WindowThemePreference::equal

    WindowThemePreference::not_equal

    app_path

    fn app_path() -> String

    Returns the application resource root, corresponding to Electron's app.getAppPath().

    asset

    fn asset(title : String, path : String, width? : Int, height? : Int, debug? : Bool, resizable? : Bool) -> App

    Creates an inline asset application.

    check_for_update

    async fn check_for_update() -> UpdateCheck

    Asks the configured channel whether a newer release is on offer.

    Available to the application at any time, not only at launch. Returns NotConfigured rather than UpToDate when there is no channel, because "nobody told us where to look" and "we looked and found nothing" are different answers and only one of them is worth showing a user.

    file

    fn file(title : String, path : String, width? : Int, height? : Int, debug? : Bool, resizable? : Bool) -> App

    Creates an inline file application.

    html

    fn html(title : String, html : String, width? : Int, height? : Int, debug? : Bool, resizable? : Bool) -> App

    Creates an inline HTML application.

    is_packaged

    fn is_packaged() -> Bool

    Returns whether this process is running from a Proton package.

    native_image

    fn native_image() -> NativeImage raise NativeImageError

    Creates an empty native image. Add at least one representation before use.

    native_theme

    fn native_theme() -> NativeTheme raise NativeThemeError

    Reports the operating system appearance Proton follows.

    Mirrors Electron's nativeTheme query surface: it is window independent and does not require a running session. Renderer prefers-color-scheme keeps following the operating system, because the current CEF public API exposes no renderer color-scheme override.

    native_theme_set_source

    fn native_theme_set_source(source : WindowThemePreference) -> Unit raise NativeThemeError

    Overrides the application-level theme source, matching Electron's nativeTheme.themeSource.

    Light and Dark win over the operating system value reported by native_theme(); System restores the operating system value. Per-window WindowHandle::set_window_theme stays authoritative for that window's chrome.

    resource_dir

    fn resource_dir() -> String

    Resolves the absolute application resource directory.

    proton_cli dev supplies the project resource directory explicitly. A packaged application resolves the package resource directory beside its executable. Directly launched code uses the current working directory.

    screens

    fn screens() -> Array[ScreenInfo] raise ScreenQueryError

    Returns information about the displays currently visible to the app.

    set_jump_list

    fn set_jump_list(categories : Array[JumpListCategory]?) -> JumpListResult raise AppControlError

    Replaces the application's custom Windows jump list, or removes it when categories is None.

    Mirrors Electron's app.setJumpList. The result reports what Windows did: Ok, Error, InvalidSeparator when a separator appears outside the Tasks category, FileTypeRegistrationError when a file link has no registered handler, and CustomCategoryAccessDenied when privacy or group policy settings block custom categories. macOS and Linux report Unsupported, where Electron leaves the method undefined.

    The list belongs to the application's AppUserModelID. An installed application registers that identity in its installer; without one Windows derives it from the executable path, which is the same identity the taskbar button uses. Users can remove items from custom categories, and Windows ignores any category that re-adds a removed item until the next successful call.

    system_preferred_languages

    Returns the operating system's valid preferred languages in preference order. Invalid platform entries are ignored.

    url

    fn url(title : String, url : String, width? : Int, height? : Int, debug? : Bool, resizable? : Bool) -> App

    Creates an inline URL application.

    view

    fn view(url : String, width~ : Int, height~ : Int, x? : Int, y? : Int, visible? : Bool, z_order? : Int, background_color? : String) -> ViewConfig

    Creates a web contents view configuration for WindowHandle::add_view, following the Electron new WebContentsView(options) model: the view renders url inside its owning window's content area at explicit top-left bounds, stacked above the window's main page.