Optional
acceleratorEnable keyboard shortcuts for devtools, zoom, reload, and reload ignoring cache.
Optional
alphaTurns anything of matching RGB value transparent.
Caveats:
Optional
alwaysOptional
apiConfigurations for API injection.
Optional
applicationOptional
aspectOptional
autoAutomatically show the window when it is created.
Optional
autoplayAutoplay 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
.
Optional
backgroundThe 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.
Optional
backgroundOptional
closetrue
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.
Optional
contentConfigures how new content (e,g, from window.open
or a link) is opened.
Optional
contentRestrict 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.
Optional
contentRestrict 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.
Optional
contextSuperseded 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.
Optional
contextConfigure the context menu when right-clicking on a window.
Optional
contextSuperseded by contextMenuOptions, which offers a larger feature-set and cleaner syntax.
Configure the context menu when right-clicking on a window.
Optional
cornerDefines 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.
Optional
customA 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);
}
});
}
Optional
customA field that the user can attach serializable data to be ferried around with the window options. When omitted, inherits from the parent application.
Optional
customCustom headers for requests sent by the window.
Optional
defaultCenters 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.
Optional
defaultOptional
defaultOptional
defaultOptional
defaultOptional
downloadControls the styling and behavior of the window download shelf.
Optional
experimentalOptional
fdc3Optional
frameOptional
heightOptional
hideOptional
hotkeysDefines 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.
Optional
iconA 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.
Optional
ignoreIgnores the cached state of the window.
Defaults the opposite value of saveWindowState
to maintain backwards compatibility.
Optional
includeOptional
inheritanceControls 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.
Optional
interopOptional
layoutOptional
Experimental
layoutThe collection of layouts to load when the window is created. When launching multiple layouts, manage the lifecycle via fin.Platform.Layout.create()/destroy() methods.
Optional
maxOptional
maxOptional
maximizableOptional
minOptional
minOptional
minimizableOptional
modalParent identity of a modal window. It will create a modal child window when this option is set.
The name of the window.
Optional
opacityOptional
permissionsAPI permissions for code running in the window.
Optional
preloadScripts that run before page load. When omitted, inherits from the parent application.
Optional
processString tag that attempts to group like-tagged renderers together. Will only be used if pages are on the same origin.
Optional
resizableOptional
resizeDefines a region in pixels that will respond to user mouse interaction for resizing a frameless window.
Optional
savetrue
Caches the location of the window.
Note: this option is ignored in Platforms as it would cause inconsistent applySnapshot behavior.
Optional
shadowOptional
showOptional
showOptional
smallfalse
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.
Optional
stateSpecify a path of a custom CSS file to be injected to all of the platform's windows. note: this option is only applied to windows that use the Default OpenFin Window. Windows with a specified url (Custom Windows) will not be affected by this option.
Optional
taskbarOptional
taskbarSpecify a taskbar group for the window.
If omitted, defaults to app's uuid (fin.Application.getCurrentSync().identity.uuid
).
Optional
throttlingWindow 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.Optional
urlOptional
uuidThe uuid
of the application, unique within the set of all Application
s 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.
Optional
viewPlatform Windows Only. Controls behavior for showing views when they are being resized by the user.
Optional
viewsOptional
waitOptional
widthOptional
xOptional
y
Window options apply to all platform windows. Any Window option is also a valid Default Window option used by default in any window that is created in the current platform's scope. Individual window options will override these defaults.