AboutSupportDeveloper GuideVersion 40.130.101.1

Window options that cannot be changed after creation.

interface ConstWindowOptions {
    accelerator: Partial<Accelerator>;
    api: ApiSettings;
    applicationIcon: string;
    autoShow: boolean;
    autoplayPolicy: AutoplayPolicyOptions;
    backgroundColor: string;
    backgroundThrottling: boolean;
    closeOnLastViewRemoved: boolean;
    contentCreation: ContentCreationOptions;
    contentNavigation: NavigationRules;
    contentRedirect: Partial<NavigationRules>;
    customRequestHeaders: CustomRequestHeaders[];
    defaultCentered: boolean;
    defaultHeight: number;
    defaultLeft: number;
    defaultTop: number;
    defaultWidth: number;
    downloadShelf: DownloadShelfOptions;
    excludeOptions: ExcludeOptions;
    experimental?: any;
    fdc3InteropApi?: string;
    height: number;
    ignoreSavedWindowState: boolean;
    inheritance?: Partial<InheritableOptions>;
    layout: any;
    layoutSnapshot: LayoutSnapshot;
    modalParentIdentity: Identity;
    name: string;
    permissions: Partial<Permissions>;
    preloadScripts: PreloadScript[];
    processAffinity: string;
    saveWindowState: boolean;
    shadow: boolean;
    smallWindow: boolean;
    state: WindowState;
    taskbarIcon: string;
    url: string;
    uuid: string;
    viewVisibility?: ViewVisibilityOptions;
    viewsPreventingClose: "layout" | "all";
    waitForPageLoad: boolean;
    width: number;
    x: number;
    y: number;
}

Properties

accelerator: Partial<Accelerator>

Enable keyboard shortcuts for devtools, zoom, reload, and reload ignoring cache.

Configurations for API injection.

applicationIcon: string

use icon instead.

autoShow: boolean

Automatically show the window when it is created.

autoplayPolicy: AutoplayPolicyOptions

Autoplay policy to apply to content in the window, can be no-user-gesture-required, user-gesture-required, document-user-activation-required. Defaults to no-user-gesture-required.

backgroundColor: string

The window’s backfill color as a hexadecimal value. Not to be confused with the content background color (document.body.style.backgroundColor), this color briefly fills a window’s (a) content area before its content is loaded as well as (b) newly exposed areas when growing a window. Setting this value to the anticipated content background color can help improve user experience. Default is white.

backgroundThrottling: boolean

false

Determines whether WebContents will throttle animations and timers when the page becomes backgrounded. This also affects the Page Visibility API.

When true, the page is throttled whether it is hidden or not.

closeOnLastViewRemoved: boolean

true

Setting this to false would keep the Window alive even if all its Views were closed. This is meant for advanced users and should be used with caution. Limitations - Once a Layout has been emptied out of all views it's not usable anymore, and certain API calls will fail. Use layout.replace to create a fresh Layout instance in case you want to populate it with Views again. NOTE: - This option is ignored in non-Platforms apps.

contentCreation: ContentCreationOptions

Configures how new content (e,g, from window.open or a link) is opened.

contentNavigation: NavigationRules

Restrict navigation to URLs that match an allowed pattern. In the lack of an allowlist, navigation to URLs that match a denied pattern would be prohibited. See here for more details.

contentRedirect: Partial<NavigationRules>

Restrict redirects to URLs that match an allowed pattern. In the lack of an allowlist, redirects to URLs that match a denied pattern would be prohibited. See here for more details.

customRequestHeaders: CustomRequestHeaders[]

Custom headers for requests sent by the window.

defaultCentered: boolean

Centers the window in the primary monitor. This option overrides defaultLeft and defaultTop. When saveWindowState is true, this value will be ignored for subsequent launches in favor of the cached value.

NOTE: On macOS defaultCenter is somewhat above center vertically.

defaultHeight: number

500

The default height of the window. When saveWindowState is true, this value will be ignored for subsequent launches in favor of the cached value.

defaultLeft: number

100

The default left position of the window. When saveWindowState is true, this value will be ignored for subsequent launches in favor of the cached value.

defaultTop: number

100

The default top position of the window. When saveWindowState is true, this value will be ignored for subsequent launches in favor of the cached value.

defaultWidth: number

800

The default width of the window. When saveWindowState is true, this value will be ignored for subsequent launches in favor of the cached value.

downloadShelf: DownloadShelfOptions

Controls the styling and behavior of the window download shelf.

This will control the styling for the download shelf regardless of whether its display was triggered by the window itself, or a view targeting the window.

excludeOptions: ExcludeOptions

Control which options to ignore when creating a Platform Window.

experimental?: any
fdc3InteropApi?: string
height: number
ignoreSavedWindowState: boolean

Ignores the cached state of the window. Defaults the opposite value of saveWindowState to maintain backwards compatibility.

inheritance?: Partial<InheritableOptions>

Controls whether an option is inherited from the parent application. The option is set as part of the window options for the parent application in either the Manifest.startup_app or Manifest.platform properties in the manifest or in ApplicationOptions.mainWindowOptions when calling Application.start. Use { [option]: false } to disable a specific [option]. All inheritable properties will be inherited by default if omitted.

layout: any
layoutSnapshot: LayoutSnapshot

The collection of layouts to load when the window is created. When launching multiple layouts, manage the lifecycle via fin.Platform.Layout.create()/destroy() methods.

modalParentIdentity: Identity

Parent identity of a modal window. It will create a modal child window when this option is set.

name: string

The name of the window.

permissions: Partial<Permissions>

API permissions for code running in the window.

Superseded by DomainSettings.default.api.permissions - if present, this setting will be ignored. It is recommended for users to migrate to a domain-based security model, since it is more natural to assign trust to the source of the page content than to the context rendering it.

preloadScripts: PreloadScript[]

Scripts that run before page load. When omitted, inherits from the parent application.

processAffinity: string

String tag that attempts to group like-tagged renderers together. However, there is no guarantee that a different affinity value will create a different process, under the hood Chromium can enforce its own process management under certain circumstances.

Will only be used if pages are on the same origin.

saveWindowState: boolean

true

Caches the location of the window.

Note: this option is ignored in Platforms as it would cause inconsistent applySnapshot behavior.

shadow: boolean

false

Displays a shadow on frameless windows. shadow and cornerRounding are mutually exclusive. On Windows 7, Aero theme is required.

smallWindow: boolean

false

Makes this window a frameless window that can be created and resized to less than 41x36 px (width x height).

Note: Caveats of small windows are no Aero Snap and drag to/from maximize. Windows 10: Requires maximizable to be false. Resizing with the mouse is only possible down to 38x39 px.

"normal"

The visible state of the window on creation. One of:

  • "maximized"
  • "minimized"
  • "normal"
taskbarIcon: string
  • use icon instead.
url: string
"about:blank"

The URL of the window
uuid: string

The uuid of the application, unique within the set of all Applications running in OpenFin Runtime. If omitted, defaults to the uuid of the application spawning the window. If given, must match the uuid of the application spawning the window. In other words, the application's uuid is the only acceptable value, but is the default, so there's really no need to provide it.

viewVisibility?: ViewVisibilityOptions

Platform Windows Only. Controls behavior for showing views when they are being resized by the user.

viewsPreventingClose: "layout" | "all"

'all'

When closeOnLastViewRemoved is set to true, determines which views prevent closing the window.

    • Defaults to all. You may want to switch this to layout if using View closeBehavior: 'hide'. NOTE: - This option is ignored in non-Platforms apps.
waitForPageLoad: boolean

false

When set to true, the window will not appear until the window object's load event fires. When set to false, the window will appear immediately without waiting for content to be loaded.

width: number
x: number
y: number