Module: System

Methods

(static) addEventListener(type, listener, callbackopt, errorCallbackopt)

Registers an event listener on the specified event.

Parameters:
Name Type Attributes Description
type string

The type of the event

listener function

will be called whenever an event of the specified type occurs. It is passed an event object containing information related to the event.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) clearCache(options, callbackopt, errorCallbackopt)

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

Parameters:
Name Type Attributes Description
options Object
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) deleteCacheOnRestart(callbackopt, errorCallbackopt)

Clears all cached data when OpenFin Runtime is restarted.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) exit(callbackopt, errorCallbackopt)

Exits the Runtime.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getAllApplications(callback, errorCallbackopt)

Retrieves an array of data for all applications.

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getAllWindows(callback, errorCallbackopt)

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

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getCommandLineArguments(callback, errorCallbackopt)

Retrieves the command line argument string that started OpenFin Runtime.

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getDeviceId(callback, errorCallbackopt)

Gets the UUID of the computer on which the runtime is installed.

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getEnvironmentVariable(varsToExpand, callback, errorCallbackopt)

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

Parameters:
Name Type Attributes Description
varsToExpand string

key of the environment variable

callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getLog(log, callback, errorCallbackopt)

Retrieves the contents of the log with the specified filename.

Parameters:
Name Type Attributes Description
log string

file name

callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getLogList(callback, errorCallbackopt)

Retrieves an array containing information for each log file.

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getMonitorInfo(callback, errorCallbackopt)

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

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getMousePosition(callback, errorCallbackopt)

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

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getProcessList(callback, errorCallbackopt)

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.

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getProxySettings(callback, errorCallbackopt)

Retrieves the Proxy settings.

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) getVersion(callback, errorCallbackopt)

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

Parameters:
Name Type Attributes Description
callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) launchExternalProcess(options, callbackopt, errorCallbackopt)

Runs an executable or batch file.

Parameters:
Name Type Attributes Description
options Object

see tutorial

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) log(level, message, callbackopt, errorCallbackopt)

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

Parameters:
Name Type Attributes Description
level string

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

message string

The log message text.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) monitorExternalProcess(pid, callback, errorCallbackopt)

Monitors a running process.

Parameters:
Name Type Attributes Description
pid string

The process id to be monitored.

callback function

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:
  • Tutorial: system.monitorExternalProcess

(static) openUrlWithBrowser(url, callbackopt, errorCallbackopt)

Opens the passed URL in the default web browser.

Parameters:
Name Type Attributes Description
url string

The URL to open.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) registerExternalConnection(uuid, callback, errorCallback) → {undefined}

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 strin

A uuid for the remote connection

callback function

Called if method succeeds Provides the object with the token and passed uuid

errorCallback function

Called if method fails

Returns:
Type
undefined

(static) releaseExternalProcess(processUuid, callbackopt, errorCallbackopt)

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

Parameters:
Name Type Attributes Description
processUuid string

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

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) removeEventListener(type, listener, callbackopt, errorCallbackopt)

Removes a previously registered event listener from the specified event.

Parameters:
Name Type Attributes Description
type string

The type of the event

listener function

will be called whenever an event of the specified type occurs. It is passed an event object containing information related to the event.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) setClipboard(text, callbackopt, errorCallbackopt)

Sets a given string value to the clipboard

Parameters:
Name Type Attributes Description
text string

string value to copy to the clipboard.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) showChromeNotificationCenter(callbackopt, errorCallbackopt)

Shows Chrome notification center

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

(static) showDeveloperTools(uuid, name, callbackopt, errorCallbackopt)

Shows Developer console for a window

Parameters:
Name Type Attributes Description
uuid String

of application

name String

of the window

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

(static) terminateExternalProcess(processUuid, timeout, killTree, callbackopt, errorCallbackopt)

Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds.

Parameters:
Name Type Attributes Description
processUuid string

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

timeout int

How long to wait in milliseconds for a process to close. Will terminate if it has not done so.

killTree boolean

Does the runtime recursively terminate processes that were lunched by the given process ?

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) updateProxySettings(string, string, int, callbackopt, errorCallbackopt)

Update the OpenFin Runtime Proxy settings.

Parameters:
Name Type Attributes Description
string type

Proxy Type.

string type

The configured Proxy Address.

int type

The configured Proxy port.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials: