AboutSupportDeveloper GuideVersion 47.154.100.2
OpenFin JavaScript API
    Preparing search index...

    Interface ApplicationCreationOptions

    The options object required by Application.start.

    The following options are required:

    • uuid is required in the app manifest as well as by Application.start
    • name is optional in the app manifest but required by Application.start
    • url is optional in both the app manifest Application.start and but is usually given (defaults to "about:blank" when omitted).

    IMPORTANT NOTE: This object inherits all the properties of the window creation options object, which will take priority over those of the same name that may be provided in mainWindowOptions.

    interface ApplicationCreationOptions {
        accelerator?: Partial<Accelerator>;
        alwaysOnTop?: boolean;
        api?: ApiSettings;
        apiDiagnostics?: boolean;
        appLogsTimezone?: TimeZones;
        aspectRatio?: number;
        autoplayPolicy?: AutoplayPolicyOptions;
        autoShow?: boolean;
        backgroundColor?: string;
        commands?: ShortcutOverride[];
        contentNavigation?: NavigationRules;
        contextMenu?: boolean;
        cornerRounding?: Partial<CornerRounding>;
        customData?: any;
        customRequestHeaders?: CustomRequestHeaders[];
        defaultCentered?: boolean;
        defaultDomainSettings?: DomainSettings;
        defaultHeight?: number;
        defaultLeft?: number;
        defaultTop?: number;
        defaultViewOptions?: Partial<ViewOptions>;
        defaultWidth?: number;
        defaultWindowOptions?: Partial<PlatformWindowOptions>;
        disableIabSecureLogging?: boolean;
        domainSettings?: DomainSettings;
        enableBeforeUnload?: boolean;
        enableJumpList?: boolean;
        hideOnClose?: boolean;
        icon?: string;
        ignoreSavedWindowState?: boolean;
        interopBrokerConfiguration?: InteropBrokerOptions;
        isPlatformController?: boolean;
        loadErrorMessage?: string;
        mainWindowOptions?: WindowCreationOptions;
        maxHeight?: number;
        maximizable?: boolean;
        maxViewPoolSize?: number;
        maxWidth?: number;
        minHeight?: number;
        minimizable?: boolean;
        minWidth?: number;
        name: string;
        nonPersistent?: boolean;
        opacity?: number;
        permissions?: Partial<Permissions>;
        plugins?: boolean;
        preloadScripts?: PreloadScript[];
        preventQuitOnLastWindowClosed?: boolean;
        resizable?: boolean;
        resizeRegion?: ResizeRegion;
        saveWindowState?: boolean;
        shadow?: boolean;
        showTaskbarIcon?: boolean;
        smallWindow?: boolean;
        snapshot?: Snapshot;
        spellCheck?: boolean;
        state?: WindowState;
        taskbarIconGroup?: string;
        url?: string;
        uuid: string;
        waitForPageLoad?: boolean;
        webSecurity?: boolean;
    }
    Index
    accelerator?: Partial<Accelerator>

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

    alwaysOnTop?: boolean

    Always position the window at the top of the window stack.

    false
    

    Configurations for API injection.

    apiDiagnostics?: boolean

    When set to false it will disable OpenFin Diagnostics for the app.

    true
    
    appLogsTimezone?: TimeZones

    Set the timezone for the app logs. When setting this value the timestamp will be in ISO 8601 format. By default, if no value is set, it will show the local time in this format: 'y-MM-dd HH:mm:ss.SSS'

    aspectRatio?: number

    The aspect ratio of width to height to enforce for the window. If this value is equal to or less than zero, an aspect ratio will not be enforced.

    0
    
    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.

    autoShow?: boolean

    Automatically show the window when it is created.

    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.

    commands?: ShortcutOverride[]

    Configuration for keyboard commands. For details and usage, see Using Keyboard Commands.

    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.

    contextMenu?: boolean

    Superseded by contextMenuOptions, which offers a larger feature-set and cleaner syntax.

    Show the context menu when right-clicking on the window. Gives access to the devtools for the window.

    true
    
    cornerRounding?: Partial<CornerRounding>

    Defines and applies rounded corners for a frameless window. NOTE: On macOS corner is not ellipse but circle rounded by the average of height and width.

    customData?: any

    A field that the user can attach serializable data to be ferried around with the window options. When omitted, inherits from the parent application.

    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.

    defaultDomainSettings?: DomainSettings

    Please use domainSettings instead

    defaultHeight?: number

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

    500
    
    defaultLeft?: number

    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.

    100
    
    defaultTop?: number

    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.

    100
    
    defaultViewOptions?: Partial<ViewOptions>

    Platforms Only. Default view options apply to all platform views.

    defaultWidth?: number

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

    800
    
    defaultWindowOptions?: Partial<PlatformWindowOptions>

    Platforms Only. Default window options apply to all platform windows.

    disableIabSecureLogging?: boolean

    Disables IAB secure logging for the app.

    false
    
    domainSettings?: DomainSettings

    Define the file download rules and domain-based api injection rules.

    enableBeforeUnload?: boolean

    When set to true, any beforeunload handler set on the app will fire.

    false
    
    enableJumpList?: boolean

    Enables the use of the Jumplists API and the 'pin to taskbar' functionality. Only relevant in Windows.

    false
    
    hideOnClose?: boolean

    Hides the window instead of closing it when the close button is pressed.

    false
    
    icon?: string

    A URL for the icon to be shown in the window title bar and the taskbar. When omitted, inherits from the parent application.

    Note: Window OS caches taskbar icons, therefore an icon change might only be visible after the cache is removed or the uuid is changed.

    ignoreSavedWindowState?: boolean

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

    interopBrokerConfiguration?: InteropBrokerOptions

    Configuration for interop broker.

    isPlatformController?: boolean
    loadErrorMessage?: string

    An error message to display when the application (launched via manifest) fails to load. A dialog box will be launched with the error message just before the runtime exits. Load fails such as failed DNS resolutions or aborted connections as well as cancellations, e.g., window.stop(), will trigger this dialog. Client response codes such as 404 Not Found are not treated as fails as they are valid server responses.

    'There was an error loading the application.'
    
    mainWindowOptions?: WindowCreationOptions

    The options of the main window of the application.

    maxHeight?: number

    The maximum height of a window. Will default to the OS defined value if set to -1.

    -1
    
    maximizable?: boolean

    Allows the window to be maximized.

    true
    
    maxViewPoolSize?: number

    Platforms Only. The maximum number of "detached" or "pooled" Views that can exist in the Platform before being closed. If you do not wish for views to be pooled on your platform, set this property to zero.

    1000
    
    maxWidth?: number

    The maximum width of a window. Will default to the OS defined value if set to -1.

    -1
    
    minHeight?: number

    The minimum height of the window.

    0
    
    minimizable?: boolean

    Allows the window to be minimized.

    true
    
    minWidth?: number

    The minimum width of the window.

    true
    
    name: string

    The name of the application.

    This property is used for naming the application logging folder, which will be sanitized to remove any special characters, spaces or international characters. It's also used in error messages, API security dialog boxes and in the directory name in %localappdata%/OpenFin/apps/.

    This property will be deprecated in the future.

    nonPersistent?: boolean

    A flag to configure the application as non-persistent. Runtime exits when there are no persistent apps running.

    false
    
    opacity?: number

    A flag that specifies how transparent the window will be. Changing opacity doesn't work on Windows 7 without Aero so setting this value will have no effect there. This value is clamped between 0.0 and 1.0. In software composition mode, the runtime flag --allow-unsafe-compositing is required.

    1
    
    permissions?: Partial<Permissions>

    The permissions for secured APIs.

    plugins?: boolean

    Enable Flash at the application level.

    false
    
    preloadScripts?: PreloadScript[]

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

    preventQuitOnLastWindowClosed?: boolean

    Platforms Only. Prevent the Platform Provider from quitting automatically when the last Platform Window is closed.

    Note: if the Platform Provider is showing, it won't close automatically. If you want a hidden Platform Provider to remain open after the last Platform Window has been closed, set this property to true.

    false
    
    resizable?: boolean

    A flag to allow the user to resize the window.

    true
    
    resizeRegion?: ResizeRegion

    Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window.

    saveWindowState?: boolean

    Caches the location of the window.

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

    true
    
    shadow?: boolean

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

    false
    
    showTaskbarIcon?: boolean

    Shows the window's icon in the taskbar.

    In Windows, setting showTaskbarIcon to false will cause the window to display on all virtual desktops. In order to prevent this while keeping showTaskbarIcon false, pass the identity of the parent via the modalParentIdentity (see WindowCreationOptions). This is useful for popups managed by Window._Window.showPopupWindow.

    true
    
    smallWindow?: boolean

    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.

    false
    
    snapshot?: Snapshot

    Platforms Only. The snapshot to be applied.

    spellCheck?: boolean

    Enable spell check at the application level.

    false
    
    state?: WindowState

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

    • "maximized"
    • "minimized"
    • "normal"
    "normal"
    
    taskbarIconGroup?: string

    Specify a taskbar group for the window. Can be shared across applications.

    If omitted from a main window, defaults to app's uuid (fin.Application.getCurrentSync().identity.uuid). Use platform.defaultWindowOptions.taskbarIconGroup to set a default for platform applications. If omitted, defaults to app's uuid (fin.Application.getCurrentSync().identity.uuid).

    It's only updatable when enableJumpList is set to false.

    url?: string

    The url to the application (specifically the application's main window).

    'about:blank'
    
    uuid: string

    The Unique Universal Identifier (UUID) of the application, unique within the set of all other applications running in the OpenFin Runtime.

    waitForPageLoad?: boolean

    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.

    false
    
    webSecurity?: boolean

    When set to false it will disable the same-origin policy for the app.

    true