OpenFin Workspace Platform API
    Preparing search index...

    Interface BrowserCreateWindowRequest

    Request for creating a browser window.

    interface BrowserCreateWindowRequest {
        accelerator?: Partial<Accelerator>;
        aiPanelOptions?: AiPanelOptions;
        alphaMask?: RGB;
        alwaysOnTop?: boolean;
        api?: ApiSettings;
        applicationIcon?: string;
        appLogLevel?: AppLogLevel;
        aspectRatio?: number;
        autoplayPolicy?: AutoplayPolicyOptions;
        autoShow?: boolean;
        backgroundColor?: string;
        backgroundThrottling?: boolean;
        chromiumPolicies?: ChromiumPolicies;
        closeOnLastViewRemoved?: boolean;
        contentCreation?: ContentCreationOptions;
        contentNavigation?: NavigationRules;
        contentRedirect?: Partial<ContentRedirect>;
        contextMenu?: boolean;
        contextMenuOptions?: ContextMenuOptions;
        contextMenuSettings?: ContextMenuSettings;
        cornerRounding?: Partial<CornerRounding>;
        customContext?: any;
        customData?: any;
        customRequestHeaders?: CustomRequestHeaders[];
        defaultCentered?: boolean;
        defaultHeight?: number;
        defaultLeft?: number;
        defaultTop?: number;
        defaultWidth?: number;
        disableAppRegion?: boolean;
        downloadBubble?: DownloadBubbleOptions;
        downloadShelf?: DownloadShelfOptions;
        excludeOptions?: ExcludeOptions;
        fdc3InteropApi?: string;
        frame?: boolean;
        height?: number;
        hideOnClose?: boolean;
        hotkeys?: Hotkey[];
        icon?: string;
        ignoreChildFrameName?: boolean;
        ignoreSavedWindowState?: boolean;
        includeInSnapshots?: boolean;
        inheritance?: Partial<InheritableOptions>;
        interop?: InteropConfig;
        layout?: any;
        layoutSnapshot?: LayoutSnapshot;
        maxHeight?: number;
        maximizable?: boolean;
        maxWidth?: number;
        minHeight?: number;
        minimizable?: boolean;
        minWidth?: number;
        modalParentIdentity?: Identity_4;
        name?: string;
        opacity?: number;
        permissions?: Partial<Permissions_2>;
        preloadScripts?: PreloadScript[];
        processAffinity?: string;
        reason?: WindowCreationReason;
        resizable?: boolean;
        resizeRegion?: ResizeRegion;
        roundedCorners?: boolean;
        saveWindowState?: boolean;
        shadow?: boolean;
        showBackgroundImages?: boolean;
        showTaskbarIcon?: boolean;
        smallWindow?: boolean;
        state?: WindowState;
        taskbarIcon?: string;
        taskbarIconGroup?: string;
        throttling?: WindowThrottling;
        updateStateIfExists?: boolean;
        url?: string;
        uuid?: string;
        viewsPreventingClose?: "layout" | "all";
        viewVisibility?: ViewVisibilityOptions;
        waitForPageLoad?: boolean;
        width?: number;
        workspacePlatform:
            | BrowserWorkspacePlatformWindowOptions
            | { windowType: Platform };
        x?: number;
        y?: number;
    }

    Hierarchy

    • Omit<OpenFin.PlatformWindowCreationOptions, "workspacePlatform" | "icon">
      • BrowserCreateWindowRequest
    Index
    accelerator?: Partial<Accelerator>

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

    aiPanelOptions?: AiPanelOptions
    • The Ai Panel options for the window. If the url is not set, the panel will not show up.
    alphaMask?: RGB

    Turns anything of matching RGB value transparent.

    Caveats:

    • Runtime flags --disable-gpu and --allow-unsafe-compositing are required. Note: Unclear behavior on remote Desktop support
    • User cannot click-through transparent regions
    • Not supported on Mac
    • Windows Aero must be enabled
    • Won't make visual sense on Pixel-pushed environments such as Citrix
    • Not supported on rounded corner windows
    alwaysOnTop?: boolean

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

    false
    
    api?: ApiSettings

    Configurations for API injection.

    applicationIcon?: string

    use icon instead.

    appLogLevel?: AppLogLevel

    Specifies the AppLogLevel for the Window. See AppLogLevel for more information.

    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.

    backgroundThrottling?: boolean

    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.

    false
    
    chromiumPolicies?: ChromiumPolicies

    {@inheritDoc ChromiumPolicies}

    closeOnLastViewRemoved?: boolean

    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.

    true
    
    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<ContentRedirect>

    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.

    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
    
    contextMenuOptions?: ContextMenuOptions

    Configure the context menu when right-clicking on a window.

    contextMenuSettings?: ContextMenuSettings

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

    Configure the context menu when right-clicking on a window.

    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.

    customContext?: any

    A field that the user can use to attach serializable data that will be saved when Platform#getSnapshot Platform.getSnapshot is called. If a window in a Platform is trying to update or retrieve its own context, it can use the Platform.setWindowContext and Platform.getWindowContext calls. When omitted, inherits from the parent application. As opposed to customData, this is meant for frequent updates and sharing with other contexts.

    This Example shows a window sharing context to all it's views. By executing the code here in the correct context, the view will have global broadcastContext and addContextListener methods available. The window will synchronize context between views such that calling broadcastContext in any of the views will invoke any listeners added with addContextListener in all attached views.

    const me = fin.Window.getCurrentSync();
    me.on('options-changed', async (event) => {
    if (event.diff.customContext) {
    const myViews = await me.getCurrentViews();
    const customContext = event.diff.customContext.newVal;
    myViews.forEach(v => {
    v.updateOptions({customContext});
    });
    }
    })
    const me = fin.View.getCurrentSync();
    const broadcastContext = async (customContext) => {
    const myWindow = await me.getCurrentWindow()
    await myWindow.updateOptions({customContext})
    };
    const addContextListener = async (listener) => {
    await me.on('options-changed', (event) => {
    if (event.diff.customContext) {
    listener(event.diff.customContext.newVal);
    }
    });
    }
    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.

    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
    
    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
    
    disableAppRegion?: boolean

    When set to true, will prevent setting the -webkit-app-region and app-region css properties on the window. These css properties are used to enable dragging of a frameless window.

    false
    
    downloadBubble?: DownloadBubbleOptions

    Configuration for download bubble UI.

    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.

    fdc3InteropApi?: string
    frame?: boolean
    true

    Show the window's frame.
    height?: number
    hideOnClose?: boolean

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

    false
    
    hotkeys?: Hotkey[]

    Defines the hotkeys that will be emitted as a hotkey event on the window. Within Platform, OpenFin also implements a set of pre-defined actions called keyboard commands that can be assigned to a specific hotkey in the platform manifest.

    This example shows the example of using the hotkeys option on Windows/Views and the corresponding hotkey event emitted when a specified hotkey is pressed.

    const myMagicWindow = await fin.Window.create({
    name: 'magicWin',
    hotkeys: [
    {
    keys: 'Ctrl+M',
    }
    ]
    });
    myMagicWindow.on('hotkey', (hotkeyEvent) => {
    console.log(`A hotkey was pressed in the magic window!: ${JSON.stringify(hotkeyEvent)}`);
    });

    After the following change, the hotkey event will no longer be emitted when Ctrl+M is pressed:

    const currentHotkeys = (await myMagicWindow.getOptions()).hotkeys;
    const newHotkeys = currentHotkeys.filter(hotkey => hotkey.keys !== 'Ctrl+M');
    myMagicWindow.updateOptions({
    hotkeys: newHotkeys
    });

    The hotkeys option is configured per-instance and isn't passed down to the children of Window/View. Therefore, if you want a Window/View and all of its children to support hotkeys, you must configure the hotkeys option for every created child.

    icon?: string

    The icon to display on the taskbar.

    Use the icon property in the workspacePlatform object instead.

    ignoreChildFrameName?: boolean

    Determines whether window.open calls from web contents should use the specified target name as provided, or automatically generate a unique name. When true, each call generates a new unique target name, ensuring a new window is always created. When false, the target name passed to window.open is respected.

    ignoreSavedWindowState?: boolean

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

    includeInSnapshots?: boolean

    Include window in snapshots returned by Platform.getSnapshot(). Turning this off may be desirable when dealing with inherently temporary windows whose state shouldn't be preserved, such as modals, menus, or popups.

    true
    
    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.ApplicationModule.start Application.start. Use { [option]: false } to disable a specific [option]. All inheritable properties will be inherited by default if omitted.

    interop?: InteropConfig
    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.

    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
    
    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
    
    modalParentIdentity?: Identity_4

    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.

    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_2>

    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.

    reason?: WindowCreationReason
    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.

    roundedCorners?: boolean

    Controls whether frameless window should have rounded corners. Default is false for Windows and true for MacOS. Setting this property to false will prevent the window from being fullscreenable on macOS. On Windows versions older than Windows 11 Build 22000 this property has no effect, and frameless windows will not have rounded corners.

    saveWindowState?: boolean

    Caches the location of the window.

    Note: this option is ignored in Platforms as it would cause inconsistent Platform#applySnapshot 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
    
    showBackgroundImages?: boolean

    Platforms Only. If true, will show background images in the layout when the Views are hidden. This occurs when the window is resizing or a tab is being dragged within the layout.

    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
    
    state?: WindowState

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

    • "maximized"
    • "minimized"
    • "normal"
    "normal"
    
    taskbarIcon?: string
    • use icon instead.
    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.

    throttling?: WindowThrottling

    {@inheritDoc WindowThrottling}

    'enabled'
    

    If throttling option is present, the backgroundThrottling option is completely ignored for windows.

    updateStateIfExists?: boolean
    url?: string

    The URL of the window

    "about:blank"
    
    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.

    <application UUID>
    
    viewsPreventingClose?: "layout" | "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.

    'all'
    
    viewVisibility?: ViewVisibilityOptions

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

    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
    
    width?: number
    workspacePlatform:
        | BrowserWorkspacePlatformWindowOptions
        | { windowType: Platform }

    WorkspacePlatform specific window options. These options will not work unless a workspace platform has been initialized.

    Type Declaration

    • BrowserWorkspacePlatformWindowOptions
    • { windowType: Platform }
      • windowType: Platform

        For internal usage. Defaults to 'browser' when Browser is enabled when the WorkspacePlatform is initialized. In order to use non-Browser layout windows ('platform' windows) in a Browser-enabled workspace platform, set windowType to platform. In that instance, the other properties in the workspacePlatform object are not relevant.

    x?: number
    y?: number