AboutSupportDeveloper GuideVersion 41.133.100.79
interface WindowOptionDiff {
    accelerator: {
        newVal: Partial<Accelerator>;
        oldVal: Partial<Accelerator>;
    };
    alphaMask: {
        newVal: RGB;
        oldVal: RGB;
    };
    alwaysOnTop: {
        newVal: boolean;
        oldVal: boolean;
    };
    api: {
        newVal: ApiSettings;
        oldVal: ApiSettings;
    };
    applicationIcon: {
        newVal: string;
        oldVal: string;
    };
    aspectRatio: {
        newVal: number;
        oldVal: number;
    };
    autoShow: {
        newVal: boolean;
        oldVal: boolean;
    };
    autoplayPolicy: {
        newVal: AutoplayPolicyOptions;
        oldVal: AutoplayPolicyOptions;
    };
    backgroundColor: {
        newVal: string;
        oldVal: string;
    };
    backgroundThrottling: {
        newVal: boolean;
        oldVal: boolean;
    };
    chromiumPolicies: {
        newVal: ChromiumPolicies;
        oldVal: ChromiumPolicies;
    };
    closeOnLastViewRemoved: {
        newVal: boolean;
        oldVal: boolean;
    };
    contentCreation: {
        newVal: ContentCreationOptions;
        oldVal: ContentCreationOptions;
    };
    contentNavigation: {
        newVal: NavigationRules;
        oldVal: NavigationRules;
    };
    contentRedirect: {
        newVal: Partial<NavigationRules>;
        oldVal: Partial<NavigationRules>;
    };
    contextMenu: {
        newVal: boolean;
        oldVal: boolean;
    };
    contextMenuOptions: {
        newVal: ContextMenuOptions;
        oldVal: ContextMenuOptions;
    };
    contextMenuSettings: {
        newVal: ContextMenuSettings;
        oldVal: ContextMenuSettings;
    };
    cornerRounding: {
        newVal: Partial<CornerRounding>;
        oldVal: Partial<CornerRounding>;
    };
    customContext: {
        newVal: any;
        oldVal: any;
    };
    customData: {
        newVal: any;
        oldVal: any;
    };
    customRequestHeaders: {
        newVal: CustomRequestHeaders[];
        oldVal: CustomRequestHeaders[];
    };
    defaultCentered: {
        newVal: boolean;
        oldVal: boolean;
    };
    defaultHeight: {
        newVal: number;
        oldVal: number;
    };
    defaultLeft: {
        newVal: number;
        oldVal: number;
    };
    defaultTop: {
        newVal: number;
        oldVal: number;
    };
    defaultWidth: {
        newVal: number;
        oldVal: number;
    };
    downloadShelf: {
        newVal: DownloadShelfOptions;
        oldVal: DownloadShelfOptions;
    };
    excludeOptions: {
        newVal: ExcludeOptions;
        oldVal: ExcludeOptions;
    };
    experimental?: {
        newVal: any;
        oldVal: any;
    };
    fdc3InteropApi?: {
        newVal: undefined | string;
        oldVal: undefined | string;
    };
    frame: {
        newVal: boolean;
        oldVal: boolean;
    };
    height: {
        newVal: number;
        oldVal: number;
    };
    hideOnClose: {
        newVal: boolean;
        oldVal: boolean;
    };
    hotkeys: {
        newVal: Hotkey[];
        oldVal: Hotkey[];
    };
    icon: {
        newVal: string;
        oldVal: string;
    };
    ignoreSavedWindowState: {
        newVal: boolean;
        oldVal: boolean;
    };
    includeInSnapshots: {
        newVal: boolean;
        oldVal: boolean;
    };
    inheritance?: {
        newVal: undefined | Partial<InheritableOptions>;
        oldVal: undefined | Partial<InheritableOptions>;
    };
    interop: {
        newVal: InteropConfig;
        oldVal: InteropConfig;
    };
    layout: {
        newVal: any;
        oldVal: any;
    };
    layoutSnapshot: {
        newVal: LayoutSnapshot;
        oldVal: LayoutSnapshot;
    };
    maxHeight: {
        newVal: number;
        oldVal: number;
    };
    maxWidth: {
        newVal: number;
        oldVal: number;
    };
    maximizable: {
        newVal: boolean;
        oldVal: boolean;
    };
    minHeight: {
        newVal: number;
        oldVal: number;
    };
    minWidth: {
        newVal: number;
        oldVal: number;
    };
    minimizable: {
        newVal: boolean;
        oldVal: boolean;
    };
    modalParentIdentity: {
        newVal: Identity;
        oldVal: Identity;
    };
    name: {
        newVal: string;
        oldVal: string;
    };
    opacity: {
        newVal: number;
        oldVal: number;
    };
    permissions: {
        newVal: Partial<Permissions>;
        oldVal: Partial<Permissions>;
    };
    preloadScripts: {
        newVal: PreloadScript[];
        oldVal: PreloadScript[];
    };
    processAffinity: {
        newVal: string;
        oldVal: string;
    };
    resizable: {
        newVal: boolean;
        oldVal: boolean;
    };
    resizeRegion: {
        newVal: ResizeRegion;
        oldVal: ResizeRegion;
    };
    saveWindowState: {
        newVal: boolean;
        oldVal: boolean;
    };
    shadow: {
        newVal: boolean;
        oldVal: boolean;
    };
    showBackgroundImages: {
        newVal: boolean;
        oldVal: boolean;
    };
    showTaskbarIcon: {
        newVal: boolean;
        oldVal: boolean;
    };
    smallWindow: {
        newVal: boolean;
        oldVal: boolean;
    };
    state: {
        newVal: WindowState;
        oldVal: WindowState;
    };
    taskbarIcon: {
        newVal: string;
        oldVal: string;
    };
    taskbarIconGroup: {
        newVal: string;
        oldVal: string;
    };
    throttling: {
        newVal: WindowThrottling;
        oldVal: WindowThrottling;
    };
    url: {
        newVal: string;
        oldVal: string;
    };
    uuid: {
        newVal: string;
        oldVal: string;
    };
    viewVisibility?: {
        newVal: undefined | ViewVisibilityOptions;
        oldVal: undefined | ViewVisibilityOptions;
    };
    viewsPreventingClose: {
        newVal: "layout" | "all";
        oldVal: "layout" | "all";
    };
    waitForPageLoad: {
        newVal: boolean;
        oldVal: boolean;
    };
    width: {
        newVal: number;
        oldVal: number;
    };
    x: {
        newVal: number;
        oldVal: number;
    };
    y: {
        newVal: number;
        oldVal: number;
    };
}

Properties

accelerator: {
    newVal: Partial<Accelerator>;
    oldVal: Partial<Accelerator>;
}

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

alphaMask: {
    newVal: RGB;
    oldVal: RGB;
}

Turns anything of matching RGB value transparent.

Caveats:

  • runtime key --disable-gpu is 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: {
    newVal: boolean;
    oldVal: boolean;
}
false

Always position the window at the top of the window stack.
api: {
    newVal: ApiSettings;
    oldVal: ApiSettings;
}

Configurations for API injection.

applicationIcon: {
    newVal: string;
    oldVal: string;
}

use icon instead.

aspectRatio: {
    newVal: number;
    oldVal: number;
}
0

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.
autoShow: {
    newVal: boolean;
    oldVal: boolean;
}

Automatically show the window when it is created.

autoplayPolicy: {
    newVal: AutoplayPolicyOptions;
    oldVal: 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: {
    newVal: string;
    oldVal: 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: {
    newVal: boolean;
    oldVal: 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.

chromiumPolicies: {
    newVal: ChromiumPolicies;
    oldVal: ChromiumPolicies;
}

Control behavior for Chromium policies

closeOnLastViewRemoved: {
    newVal: boolean;
    oldVal: 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: {
    newVal: ContentCreationOptions;
    oldVal: ContentCreationOptions;
}

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

contentNavigation: {
    newVal: NavigationRules;
    oldVal: 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: {
    newVal: Partial<NavigationRules>;
    oldVal: 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.

contextMenu: {
    newVal: boolean;
    oldVal: boolean;
}

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

true

Show the context menu when right-clicking on the window.
Gives access to the devtools for the window.
contextMenuOptions: {
    newVal: ContextMenuOptions;
    oldVal: ContextMenuOptions;
}

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

contextMenuSettings: {
    newVal: ContextMenuSettings;
    oldVal: ContextMenuSettings;
}

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

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

cornerRounding: {
    newVal: Partial<CornerRounding>;
    oldVal: 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: {
    newVal: any;
    oldVal: any;
}

A field that the user can use to attach serializable data that will be saved when 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: {
    newVal: any;
    oldVal: 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: {
    newVal: CustomRequestHeaders[];
    oldVal: CustomRequestHeaders[];
}

Custom headers for requests sent by the window.

defaultCentered: {
    newVal: boolean;
    oldVal: 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: {
    newVal: number;
    oldVal: 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: {
    newVal: number;
    oldVal: 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: {
    newVal: number;
    oldVal: 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: {
    newVal: number;
    oldVal: 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: {
    newVal: DownloadShelfOptions;
    oldVal: 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: {
    newVal: ExcludeOptions;
    oldVal: ExcludeOptions;
}

Control which options to ignore when creating a Platform Window.

experimental?: {
    newVal: any;
    oldVal: any;
}
fdc3InteropApi?: {
    newVal: undefined | string;
    oldVal: undefined | string;
}
frame: {
    newVal: boolean;
    oldVal: boolean;
}
true

Show the window's frame.
height: {
    newVal: number;
    oldVal: number;
}
hideOnClose: {
    newVal: boolean;
    oldVal: boolean;
}
false

Hides the window instead of closing it when the close button is pressed.
hotkeys: {
    newVal: Hotkey[];
    oldVal: 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: {
    newVal: string;
    oldVal: 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: {
    newVal: boolean;
    oldVal: boolean;
}

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

includeInSnapshots: {
    newVal: boolean;
    oldVal: boolean;
}
true

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.
inheritance?: {
    newVal: undefined | Partial<InheritableOptions>;
    oldVal: undefined | 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.

interop: {
    newVal: InteropConfig;
    oldVal: InteropConfig;
}
layout: {
    newVal: any;
    oldVal: any;
}
layoutSnapshot: {
    newVal: LayoutSnapshot;
    oldVal: 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: {
    newVal: number;
    oldVal: number;
}
-1

The maximum height of a window. Will default to the OS defined value if set to -1.
maxWidth: {
    newVal: number;
    oldVal: number;
}
-1

The maximum width of a window. Will default to the OS defined value if set to -1.
maximizable: {
    newVal: boolean;
    oldVal: boolean;
}
true

Allows the window to be maximized.
minHeight: {
    newVal: number;
    oldVal: number;
}
0

The minimum height of the window.
minWidth: {
    newVal: number;
    oldVal: number;
}
true

The minimum width of the window.
minimizable: {
    newVal: boolean;
    oldVal: boolean;
}
true

Allows the window to be minimized.
modalParentIdentity: {
    newVal: Identity;
    oldVal: Identity;
}

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

name: {
    newVal: string;
    oldVal: string;
}

The name of the window.

opacity: {
    newVal: number;
    oldVal: number;
}

1

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.

permissions: {
    newVal: Partial<Permissions>;
    oldVal: 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: {
    newVal: PreloadScript[];
    oldVal: PreloadScript[];
}

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

processAffinity: {
    newVal: string;
    oldVal: 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.

resizable: {
    newVal: boolean;
    oldVal: boolean;
}
true

A flag to allow the user to resize the window.
resizeRegion: {
    newVal: ResizeRegion;
    oldVal: ResizeRegion;
}

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

saveWindowState: {
    newVal: boolean;
    oldVal: boolean;
}

true

Caches the location of the window.

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

shadow: {
    newVal: boolean;
    oldVal: boolean;
}

false

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

showBackgroundImages: {
    newVal: boolean;
    oldVal: boolean;
}
false

**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.
showTaskbarIcon: {
    newVal: boolean;
    oldVal: boolean;
}
true

Shows the window's icon in the taskbar.
smallWindow: {
    newVal: boolean;
    oldVal: 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.

state: {
    newVal: WindowState;
    oldVal: WindowState;
}

"normal"

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

  • "maximized"
  • "minimized"
  • "normal"
taskbarIcon: {
    newVal: string;
    oldVal: string;
}
  • use icon instead.
taskbarIconGroup: {
    newVal: string;
    oldVal: 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: {
    newVal: WindowThrottling;
    oldVal: WindowThrottling;
}

Window throttling state.

  • enabled: Both background throttling and scheduler throttling are true. It's fully throttled.
  • scheduler-disabled: The background throttling is true, but scheduler throttling is disabled.
  • disabled: The background throttling is false. The throttling is fully disabled.
'enabled'

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

url: {
    newVal: string;
    oldVal: string;
}
"about:blank"

The URL of the window
uuid: {
    newVal: string;
    oldVal: 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?: {
    newVal: undefined | ViewVisibilityOptions;
    oldVal: undefined | ViewVisibilityOptions;
}

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

viewsPreventingClose: {
    newVal: "layout" | "all";
    oldVal: "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: {
    newVal: boolean;
    oldVal: 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: {
    newVal: number;
    oldVal: number;
}
x: {
    newVal: number;
    oldVal: number;
}
y: {
    newVal: number;
    oldVal: number;
}