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.

Asynchronous Methods

All the above listed methods are both:

  • Static — called directly on the System namespace
  • Asynchronous — having an undefined immediate return value but eventually invoking either callback or errorCallback

Members

(static) Clipboard :fin.desktop.System.Clipboard

Type:

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

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

See tutorial for more details.

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) deleteCacheOnExit(callbackopt, errorCallbackopt)

Clears all cached data when OpenFin Runtime exits.

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) downloadAsset(assetObj, progressListeneropt, callbackopt, errorCallbackopt)

Downloads the given application asset

Parameters:
Name Type Attributes Description
assetObj Object

App asset object as described in: Application Config

progressListener function <optional>

called as the asset is downloaded with progress information.

callback function <optional>

called once the asset is downloaded, unziped and moved and is ready to be used.

errorCallback function <optional>

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

Tutorials:

(static) downloadRuntime(options, progressListeneropt, callbackopt, errorCallbackopt)

Downloads a version of the runtime.

Parameters:
Name Type Attributes Description
options fin.desktop.System~runtimeDownloadOptions

Download options.

progressListener function <optional>

called as the runtime is downloaded with progress information.

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(callbackopt, errorCallbackopt)

Retrieves an array of data for all applications.

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) getAllExternalApplications(callbackopt, errorCallbackopt)

Retrieves an array of data for all external applications.

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) getAllWindows(callbackopt, errorCallbackopt)

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

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) getCommandLineArguments(callbackopt, errorCallbackopt)

Retrieves the command line argument string that started OpenFin 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) getCrashReporterState(callbackopt, errorCallbackopt)

Get the current state of the crash reporter.

Parameters:
Name Type Attributes Description
callback function <optional>

returns startCrashReporterSuccessResponse object.

errorCallback Funciton <optional>

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

Tutorials:
  • Tutorial: system.getCrashReporterState

(static) getDeviceId(callbackopt, errorCallbackopt)

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

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) getDeviceUserId(callback, errorCallback)

Returns a hex encoded hash of the mac address and the currently logged in user name

Parameters:
Name Type Description
callback function

called with the hash string if successful

errorCallback function

called if the mac address or user name is unreadable

Tutorials:

(static) getEnvironmentVariable(envVar, callbackopt, errorCallbackopt)

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

Parameters:
Name Type Attributes Description
envVar string

The environment variable to expand.

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) getHostSpecs(callbackopt, errorCallbackopt)

Retrieves system information.

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) getLog(callbackopt, errorCallbackopt)

Retrieves the contents of the log with the specified filename.

Parameters:
Name Type Attributes Description
string

The log file name.

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) getLogList(callbackopt, errorCallbackopt)

Retrieves an array containing information for each log file.

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) getMonitorInfo(callbackopt, errorCallbackopt)

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

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) getMousePosition(callbackopt, errorCallbackopt)

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

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) getProcessList(callbackopt, 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 <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) getProxySettings(callbackopt, errorCallbackopt)

Retrieves the Proxy settings.

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) getRvmInfo(callbackopt, errorCallbackopt)

Returns information about the running RVM in an object.

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) getVersion(callbackopt, errorCallbackopt)

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

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) launchExternalProcess(options, callbackopt, errorCallbackopt)

Runs an executable or batch file.

Parameters:
Name Type Attributes Description
options Object

See tutorial for more details.

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(options, callbackopt, errorCallbackopt)

Monitors a running process.

Parameters:
Name Type Attributes Description
options Object

See tutorial for more details.

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) 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, callbackopt, errorCallbackopt)

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 Attributes Description
uuid string

A UUID for the remote connection.

callback function <optional>

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

errorCallback function <optional>

Called if method fails

Tutorials:

(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

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) showDeveloperTools(uuid, name, callbackopt, errorCallbackopt)

Shows the Chromium Developer Tools for the specified window.

Parameters:
Name Type Attributes Description
uuid string

The uuid of application.

name string

The name 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.

Tutorials:

(static) startCrashReporter(optionsopt, callbackopt, errorCallbackopt)

Start the crash reporter for the browser process if not already running. You can optionally specify diagnosticMode to have the logs sent to OpenFin on runtime close

Parameters:
Name Type Attributes Description
options fin.desktop.System~startCrashReporterOptions <optional>

configure crash reporter

callback function <optional>

returns startCrashReporterSuccessResponse object.

errorCallback Funciton <optional>

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

Tutorials:
  • Tutorial: system.startCrashReporter

(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(type, address, port, callbackopt, errorCallbackopt)

Update the OpenFin Runtime Proxy settings.

Parameters:
Name Type Attributes Description
type string

The proxy type.

address string

The configured proxy address.

port int

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:

Type Definitions

runtimeDownloadOptions

Runtime download options.

These are the options object required by the downloadRuntime function.

Type:
  • object
Properties:
Name Type Description
version string

The given version to download. eg: 6.49.21.9

startCrashReporterOptions

Crash reporter options options.

This is the options object required by the startCrashReporter call.

Note the following required properties:

  • diagnosticMode
Type:
  • object
Properties:
Name Type Description
diagnosticMode boolean

In diagnostic mode the crash reporter will send diagnostic logs to the OpenFin reporting service on runtime shutdown

startCrashReporterSuccessResponse

Response object.

This is the options object returned by the startCrashReporter call.

{runtimeReporter: {isRunning, diagnosticMode}}

Type:
  • object
Properties:
Name Type Description
runtimeReporter object

Contains two boolean fields, isRunning and diagnosticMode.