Namespace: System

System

An object representing the core of OpenFin Runtime. Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime as well as listen to system events.

Methods

addListener(eventType, listener, optionsopt) → {Promise.<this>}

Adds a listener to the end of the listeners array for the specified event.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

Called whenever an event of the specified type occurs.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

clearCache(options) → {Promise.<void>}

Clears cached data containing application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage.

Parameters:
Name Type Description
options ClearCacheOption

See tutorial for more details.

Tutorials:
Returns:
Type
Promise.<void>

deleteCacheOnExit() → {Promise.<void>}

Clears all cached data when OpenFin Runtime exits.

Tutorials:
Returns:
Type
Promise.<void>

downloadAsset(appAsset) → {Promise.<void>}

Downloads the given application asset
Note: This method is restricted by default and must be enabled via API security settings.

Parameters:
Name Type Description
appAsset AppAssetInfo

App asset object

Tutorials:
Returns:
Type
Promise.<void>

downloadPreloadScripts(scripts) → {Promise.Array.<DownloadPreloadInfo>}

Download preload scripts from given URLs

Parameters:
Name Type Description
scripts Array.<DownloadPreloadOption>

URLs of preload scripts. See tutorial for more details.

Tutorials:
Returns:
Type
Promise.Array.<DownloadPreloadInfo>

downloadRuntime(options, progressListeneropt) → {Promise.<void>}

Downloads a version of the runtime.

Parameters:
Name Type Attributes Description
options RuntimeDownloadOptions

Download options.

progressListener function <optional>

called as the runtime is downloaded with progress information.

Tutorials:
Returns:
Type
Promise.<void>

exit() → {Promise.<void>}

Exits the Runtime.

Tutorials:
Returns:
Type
Promise.<void>

(async) fetchManifest(manifestUrl) → {Promise.<any>}

Fetches a JSON manifest using the browser process and returns a Javascript object.

Parameters:
Name Type Description
manifestUrl string

The URL of the manifest to fetch.

Tutorials:
Returns:
Type
Promise.<any>

flushCookieStore() → {Promise.<void>}

Writes any unwritten cookies data to disk.

Tutorials:
Returns:
Type
Promise.<void>

getAllApplications() → {Promise.Array.<ApplicationState>}

Retrieves an array of data for all applications.

Tutorials:
Returns:
Type
Promise.Array.<ApplicationState>

getAllExternalApplications() → {Promise.Array.<Identity>}

Retrieves an array of data (name, ids, bounds) for all application windows.

Tutorials:
Returns:
Type
Promise.Array.<Identity>

(async) getAllProcessInfo() → {Promise.<SystemProcessInfo>}

EXPERIMENTAL

Retrieves all process information. This includes the browser process and every process associated to all entities (windows and views).

Tutorials:
Returns:
Type
Promise.<SystemProcessInfo>

getAllWindows() → {Promise.Array.<ApplicationWindowInfo>}

Retrieves an array of data (name, ids, bounds) for all application windows.

Tutorials:
Returns:
Type
Promise.Array.<ApplicationWindowInfo>

getAppAssetInfo(options) → {Promise.<AppAssetInfo>}

Retrieves app asset information.

Parameters:
Name Type Description
options AppAssetRequest
Tutorials:
Returns:
Type
Promise.<AppAssetInfo>

getCommandLineArguments() → {Promise.<string>}

Retrieves the command line argument string that started OpenFin Runtime.

Tutorials:
Returns:
Type
Promise.<string>

getCookies(options) → {Promise.Array.<CookieInfo>}

Get additional info of cookies.

Parameters:
Name Type Description
options CookieOption

See tutorial for more details.

Tutorials:
Returns:
Type
Promise.Array.<CookieInfo>

(async) getCrashReporterState() → {Promise.<CrashReporterState>}

Get the current state of the crash reporter.

Tutorials:
Returns:
Type
Promise.<CrashReporterState>

getEntityInfo(uuid, name) → {Promise.<EntityInfo>}

Retrieves a frame info object for the uuid and name passed in

Parameters:
Name Type Description
uuid string

The UUID of the target.

name string

The name of the target.

Tutorials:
Returns:
Type
Promise.<EntityInfo>

getEnvironmentVariable() → {Promise.<string>}

Gets the value of a given environment variable on the computer on which the runtime is installed

Tutorials:
Returns:
Type
Promise.<string>

getFocusedWindow() → {Promise.<(Identity|null)>}

Get current focused window.

Tutorials:
Returns:
Type
Promise.<(Identity|null)>

getHostSpecs() → {Promise.<HostSpecs>}

Retrieves system information.

Tutorials:
Returns:
Type
Promise.<HostSpecs>

getInstalledRuntimes() → {Promise.<Array.<string>>}

Returns an array of all the installed runtime versions in an object.

Tutorials:
Returns:
Type
Promise.<Array.<string>>

getLog(options) → {Promise.<string>}

Retrieves the contents of the log with the specified filename.

Parameters:
Name Type Description
options GetLogRequestType

A object that id defined by the GetLogRequestType interface

Tutorials:
Returns:
Type
Promise.<string>

getLogList() → {Promise.Array.<LogInfo>}

Retrieves an array containing information for each log file.

Tutorials:
Returns:
Type
Promise.Array.<LogInfo>

getMachineId() → {Promise.<string>}

Returns a unique identifier (UUID) provided by the machine.

Tutorials:
Returns:
Type
Promise.<string>

getMinLogLevel() → {Promise.<LogLevel>}

Returns the minimum (inclusive) logging level that is currently being written to the log.

Tutorials:
Returns:
Type
Promise.<LogLevel>

getMonitorInfo() → {Promise.<MonitorInfo>}

Retrieves an object that contains data about the monitor setup of the computer that the runtime is running on.

Tutorials:
Returns:
Type
Promise.<MonitorInfo>

getMousePosition() → {Promise.<PointTopLeft>}

Returns the mouse in virtual screen coordinates (left, top).

Tutorials:
Returns:
Type
Promise.<PointTopLeft>

(async) getPrinters() → {Promise.Array.<PrinterInfo>}

Returns an array with all printers of the caller and not all the printers on the desktop.

Tutorials:
Returns:
Type
Promise.Array.<PrinterInfo>

getProcessList() → {Promise.Array.<ProcessInfo>}

Retrieves an array of all of the runtime processes that are currently running. Each element in the array is an object containing the uuid and the name of the application to which the process belongs.

Deprecated:
Tutorials:
Returns:
Type
Promise.Array.<ProcessInfo>

getProxySettings() → {Promise.<ProxyInfo>}

Retrieves the Proxy settings.

Tutorials:
Returns:
Type
Promise.<ProxyInfo>

getRuntimeInfo() → {Promise.<RuntimeInfo>}

Returns information about the running Runtime in an object.

Tutorials:
Returns:
Type
Promise.<RuntimeInfo>

getRvmInfo() → {Promise.<RVMInfo>}

Returns information about the running RVM in an object.

Tutorials:
Returns:
Type
Promise.<RVMInfo>

(async) getServiceConfiguration(serviceIdentifier) → {Promise.<ServiceConfiguration>}

Returns the json blob found in the desktop owner settings for the specified service. More information about desktop services can be found here.

Parameters:
Name Type Description
serviceIdentifier ServiceIdentifier

An object containing a name key that identifies the service.

Tutorials:
  • Tutorial: System.getServiceConfiguration
Returns:
Type
Promise.<ServiceConfiguration>

getUniqueUserId() → {Promise.<string>}

Returns a hex encoded hash of the machine id and the currently logged in user name. This is the recommended way to uniquely identify a user / machine combination.

Tutorials:
Returns:
Type
Promise.<string>

getVersion() → {Promise.<string>}

Returns the version of the runtime. The version contains the major, minor, build and revision numbers.

Tutorials:
Returns:
Type
Promise.<string>

(async) isAppCertified() → {Promise.<CertifiedAppInfo>}

Returns information about the given app's certification status

Tutorials:
Returns:
Type
Promise.<CertifiedAppInfo>

launchExternalProcess(options) → {Promise.<Identity>}

Runs an executable or batch file. A path to the file must be included in options.
A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
Note: This method is restricted by default and must be enabled via API security settings. Also, this api has an enhanced permission set to make it less dangerous. So application owners can only allow to launch the assets owned by the application, the enabled downloaded files or the restricted executables.

Parameters:
Name Type Description
options ExternalProcessRequestType

A object that is defined in the ExternalProcessRequestType interface

Tutorials:
Returns:
Type
Promise.<Identity>

(async) launchManifest(manifestUrl, optsopt) → {Promise.<Manifest>}

EXPERIMENTAL

Launch application using a manifest URL/path. It differs from Application.startFromManifest in that this API can accept a manifest using the fin protocol.

Parameters:
Name Type Attributes Description
manifestUrl string

The manifest's URL or path.

opts RvmLaunchOptions <optional>

Parameters that the RVM will use.

Tutorials:
Returns:
Type
Promise.<Manifest>

log(level, message) → {Promise.<void>}

Writes the passed message into both the log file and the console.

Parameters:
Name Type Description
level string

The log level for the entry. Can be either "info", "warning" or "error"

message string

The log message text

Tutorials:
Returns:
Type
Promise.<void>

monitorExternalProcess(options) → {Promise.<Identity>}

Monitors a running process. A pid for the process must be included in options.
A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.

Parameters:
Name Type Description
options ExternalProcessInfo

See tutorial for more details

Tutorials:
Returns:
Type
Promise.<Identity>

on(eventType, listener, optionsopt) → {Promise.<this>}

Adds a listener to the end of the listeners array for the specified event.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

Called whenever an event of the specified type occurs.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

once(eventType, listener, optionsopt) → {Promise.<this>}

Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

The callback function.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

openUrlWithBrowser(url) → {Promise.<void>}

Opens the passed URL in the default web browser. It only supports http(s) and fin(s) protocols by default. In order to use other custom protocols, they have to be enabled via API security settings. File protocol and file path are not supported.

Parameters:
Name Type Description
url string

The URL to open

Tutorials:
Returns:
Type
Promise.<void>

prependListener(eventType, listener, optionsopt) → {Promise.<this>}

Adds a listener to the beginning of the listeners array for the specified event.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

The callback function.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

prependOnceListener(eventType, listener, optionsopt) → {Promise.<this>}

Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed. The listener is added to the beginning of the listeners array.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

The callback function.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

(async) queryPermissionForCurrentContext(apiName) → {Promise.<QueryPermissionResult>}

Query permission of a secured api in current context.

Parameters:
Name Type Description
apiName string

The full name of a secured API.

Tutorials:
Returns:
Type
Promise.<QueryPermissionResult>

readRegistryValue(rootKey, subkey, value) → {Promise.<RegistryInfo>}

Reads the specifed value from the registry.
Note: This method is restricted by default and must be enabled via API security settings.

Parameters:
Name Type Description
rootKey string

The registry root key.

subkey string

The registry key.

value string

The registry value name.

Tutorials:
Returns:
Type
Promise.<RegistryInfo>

registerExternalConnection(uuid) → {Promise.<ExternalConnection>}

This function call will register a unique id and produce a token. The token can be used to broker an external connection.

Parameters:
Name Type Description
uuid string

A UUID for the remote connection.

Tutorials:
Returns:
Type
Promise.<ExternalConnection>

(async) registerUsage(options) → {Promise.<void>}

(Internal) Register the usage of a component with a platform

Parameters:
Name Type Description
options OpenFin.RegisterUsageData

Object with data and type

Tutorials:
Returns:
Type
Promise.<void>

releaseExternalProcess(uuid) → {Promise.<void>}

Removes the process entry for the passed UUID obtained from a prior call of fin.System.launchExternalProcess().

Parameters:
Name Type Description
uuid string

The UUID for a process obtained from a prior call to fin.desktop.System.launchExternalProcess()

Tutorials:
Returns:
Type
Promise.<void>

removeAllListeners(eventTypeopt) → {Promise.<this>}

Removes all listeners, or those of the specified event.

Parameters:
Name Type Attributes Description
eventType string | symbol <optional>

The type of the event.

Tutorials:
Returns:
Type
Promise.<this>

removeListener(eventType, listener, optionsopt) → {Promise.<this>}

Remove a listener from the listener array for the specified event. Caution: Calling this method changes the array indices in the listener array behind the listener.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

The callback function.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

resolveUuid(uuid) → {Promise.<ApplicationType>}

Retrieves the UUID of the computer on which the runtime is installed

Parameters:
Name Type Description
uuid string

The uuid of the running application

Tutorials:
Returns:
Type
Promise.<ApplicationType>

runRvmHealthCheck() → {Promise.<Array.<string>>}

Signals the RVM to perform a health check and returns the results as json.

Tutorials:
Returns:
Type
Promise.<Array.<string>>

setMinLogLevel(The) → {Promise.<void>}

Set the minimum log level above which logs will be written to the OpenFin log

Parameters:
Name Type Description
The LogLevel

minimum level (inclusive) above which all calls to log will be written

Tutorials:
Returns:
Type
Promise.<void>

showDeveloperTools(identity) → {Promise.<void>}

Shows the Chromium Developer Tools for the specified window

Parameters:
Name Type Description
identity Identity

This is a object that is defined by the Identity interface

Tutorials:
Returns:
Type
Promise.<void>

(async) startCrashReporter(options) → {Promise.<CrashReporterState>}

Start the crash reporter if not already running.

Parameters:
Name Type Description
options CrashReporterOptions

configure crash reporter

Tutorials:
Returns:
Type
Promise.<CrashReporterState>

terminateExternalProcess(options) → {Promise.<void>}

Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds.
Note: This method is restricted by default and must be enabled via API security settings.

Parameters:
Name Type Description
options TerminateExternalRequestType

A object defined in the TerminateExternalRequestType interface

Tutorials:
Returns:
Type
Promise.<void>

updateProxySettings(options) → {Promise.<void>}

Update the OpenFin Runtime Proxy settings.

Parameters:
Name Type Description
options ProxyConfig

A config object defined in the ProxyConfig interface

Tutorials:
Returns:
Type
Promise.<void>