Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

BrowserClient

  • Last UpdatedJul 03, 2025
  • 6 minute read

The BrowserClient node is used to create instances of a chromium web browser in the scene. These instances can display inside a single or multiple Rect2D. A browser instance can be shown in a 2D overlay or inside a Texture2D in 3D.

  • The browser instance supports mouse and keyboard interaction in 2D and mouse/keyboard and hand interactions in 3D when the texture is placed inside an ItemMonitor.

  • The browser imageRefreshInterval can be used to set the target framerate of the browser (fps = 1000/imageRefreshInterval). The value can be set both at definition and at runtime.

  • The BrowserClient node supports transparent background visualization.

Known limitation

Multiple processes are currently not supported by BrowserClient plugin, because multiple processes would try to use the same cache folder and this would lead to an underlying Cef error. This means that while a process that includes CefBrowserPlugin.dll is running on a specific project folder, no other processes running on that application will be able to successfully load it. For example, this could be XR Studio loading a logic file from graphic context or the XR Viewer.

Platform support

This node is supported on XR-Windows platform only.

XR-WIN

XR-P-WIN

XR-P-IOS

XR-P-AND

XR-P-WASM

Full support

No support

No support

No support

No support

Full support

No support

No support

No support

No support

Plugin configuration

The Cefbrowser Plugin can be configured using the CefBrowserPlugin.dll.config file stored in the plugin folder.

Settings are applied to all node instances in the project.

Parameter

Default

Description

userAgent

""

Overrides the browser user agent and simulates a specific device.

deleteCache

true

Forces a cache deletion at every session.

enableGPU

false

Enables the use of GPU hardware for best performance, By default it is disabled.

Security considerations

  • The BrowserClient node instantiates an actual browser that needs to be managed regarding security and privacy.

  • BrowserClient offers a deleteCookies functionality that can be used to drop user data when switching users without closing the application.

  • The plugin deleteCache configuration setting of CefBrowserPlugin.dll.config can be used to force the application to delete the cache when restarted.

Security note: Be aware that loadUrl can be set by other logical nodes such as RestServer or directly by a user using an InputText2D or by simply clicking a link and can be pointed to load a malicious URL. Script code must be implemented in a way to avoid misuse of the browser.

Navigation

BrowserClient exposes a loadUrl field that can be used to navigate. It can be used to load web pages and show documents, such as PDFs.

There are back and forward actions to move though the browser history.

The currentUrl field shows the currently loaded content while the loadingState and loadingErrorMessage fields can be used to verify the state of the loading activity.

Audio and interaction

BrowserClient can perform audio. The audio is not stereo and is not positional since the audio is not coming through the engine, but from the process that manages the browser.

The audio can be turned off with the mute field.

The action field is used to disable interaction, mute audio, and stop image update. However, the browser continues to run, so it's possible to navigate, execute javascript commands, receive posted messages. The content inside the browser does not stop or pause.

Calling JavaScript functions

The BrowserClient nodes provides interaction with the current displayed content by invoking Javascript code blocks using jsCommand. It can retrieve data from the Document Object Model or execute functions.

  • When jsCommand is set, the value of the jsError field is set to unknown value and the Javascript executes asynchronously.

  • If the execution completes correctly, the state of jsError goes to ok and the result of the execution, if any, can be read in the jsResult field.

  • If the execution fails, the state goes to error and the corresponding message can be read in the jsErrorMessage field.

Message notifications

BrowserClient also supports a channel to send messages from the content of the page to the script whenever the following javascript is executed.

CefSharp.PostMessage('Message')

The corresponding Message is captured by the browser and exposed in the postedMessage field.

Code example

This is a code example for BrowserClient.

<!-- Creating a browser on screen -->

<!-- 1. load the plugin (needed once in a project before creating any BrowserClient instance) -->

<plugin file="plugins\CefBrowser\CefBrowserPlugin.dll"/>

<!-- 2. instance and configure a BrowserClient node -->

<BrowserClient name="aBrowser" size="1024 1024" loadUrl="http://www.myfavouritesite.com" imageRefreshInterval="33" />

<!-- 3. instance a Rect2D node and draw the browser inside of it -->

<Rect2D name="aRect" images="node:aBrowser" size="1024 1024" position="100 100" visible="true" />

BrowserClient fields

These are the fields for BrowserClient node. Only the node-specific fields are indicated, not fields obtained by inheritance.

Field inheritance: NodeBase > BrowserClient

Fields

Type

Use

Default value

Description

active

sbool

Optional

true

When set to false, interaction is disable, image update is disabled and audio is muted.

back

sevent

Optional

Navigates back to previous URL (if any).

currentUrl

sstring

Read-only

Internally calculated

Shows the currently loaded content. This may be the result of a loadUrl, of a link, or even of a redirect.

deleteCookies

sevent

Optional

Can be invoked to clear current user cookies. This can be useful if using the node by keeping application running and switching the user.

forward

sevent

Optional

Navigate forward to next URL (if any).

imageRefreshInterval

sint

Optional

Refresh interval in milliseconds between two image requests. It influences the max browser framerate as (maxFps= 1000/imageRefreshInterval). Set to 33 to target 30 fps.

jsCommand

sstring

Optional

Evaluates Javascript code in the context of the web browser. Can be used to read dom objects or to execute js functions.

jsError

senum

Read-only

Internally calculated

When the jsCommand is executed, the jsError state is set to undefined then moves to ok or error.

jsErrorMessage

sstring

Read-only

Internally calculated

Shows the error message when jsError is set to error. The field resets when executing another jsCommand.

jsResult

sstring

Read-only

Internally calculated

Shows the result of the jsCommand. The content of the field depends on the return type of the executed jsCommand and can be even empty.

loadingErrorMessage

sstring

Read-only

Internally calculated

When an error occurs while loading content, this field will contain the text of the error message.

loadingState

senum

Read-only

Internally calculated

Reports the current content loading state. Values can be loading, loaded, or error.

loadUrl

sstring

Optional

Can be set to a web URL, a local site URL, or a document URL in order to load that content. Not all document types are supported.

mute

sbool

Optional

false

When field is set to true, the browser audio is turned off.

postedMessage

sstring

Read-only

Internally calculated

When the browserClient receives a notification, its message is shown in this field

size

svec2

Optional

640 480

Size of the browser.

zoom

sdouble

Optional

1

Changes the browser zoom level. For example, set to 1.25 to have a zoom of 125%.

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in