Chromium Browser

Icon

The Chromium Browser is available in Aeon v4.0 and higher and Ares v4.7 and higher.

 

The Chromium Browser control manages the display and interaction with a chromium web browser. It allows for direct access to and manipulation of document elements including forms and form elements.

Properties

  • Address: The URL of the current page.
  • FieldName: A string representing the name of the control. This can be used for retrieving the control.
  • Label: A string representing the label that should be displayed beside the field on the form.
  • LabelVisible: A boolean value representing whether or not the label should be displayed.
  • TypeName: A string representing the full name of the control type.
  • WebBrowser: The underlying ChromiumWebBrowser object being managed by this control.
  • Settings: Allows for additional configuration of the chromium web browser.

Methods

CheckHandlerQueue

Forces an immediate check of the page handler queue. This is primarily used when JavaScript and AJAX enabled pages perform updates that do not require an actual page change in the browser, but need to be detected and checked by the browser.

 

Example  Expand source

EvaluateScript

Executes javascript and returns the result. There are multiple EvaluateScript method signatures taking different arguments.

Javascript Response Object

The output type of all EvaluateScript methods is defined as the following. See the examples below making use of the javascript response object.

Property Name

Type
Messagestring
Successbool
Resultobject

EvaluateScript(script)

Executes the javascript code or function name. 

Parameter Direction

Parameter Name

Parameter Description

InputscriptThe javascript code or javascript method name on the page that should be executed.
OutputjavascriptResponse

The result of the script execution as a JavascriptResponse object, defined as the following.

EvaluateScript(script, args)

Executes the javascript code or function name and passes in arguments. 

Parameter Direction

Parameter Name

Parameter Description

InputscriptThe javascript method name on the page that should be executed.
InputargsThe arguments passed to the javascript method.
OutputjavascriptResponse

The result of the script execution as a JavascriptResponse object, defined as the following.

EvaluateScript(timeout, script)

Executes the javascript code or function name with a timeout. 

Parameter Direction

Parameter Name

Parameter Description

Input

timeout

The timeout specified in milliseconds.

InputscriptThe javascript code or method name that should be executed.
OutputjavascriptResponse

The result of the script execution as a JavascriptResponse object, defined as the following.

EvaluateScript(timeout, script, args)

Executes the javascript code or function name and passes in arguments and sets a timeout. 

Parameter Direction

Parameter Name

Parameter Description

Input

timeout

The timeout specified in milliseconds.

InputscriptThe javascript method that should be executed.
InputargsThe arguments passed to the javascript method.
OutputjavascriptResponse

The result of the script execution as a JavascriptResponse object, defined as the following.

Example using script only  Expand source
Example with arguments  Expand source

ExecuteScript

Executes the supplied javascript code asynchronously in the context of the browser.

Parameter Direction

Parameter Name

Parameter Description

Input

script

The javascript code or javascript function name that should be executed.

Input - OptionalargumentsThe arguments to be passed as params to the method
Example  Expand source

Navigate

Attempts to load the specified url into the browser.

Parameter Direction

Parameter Name

Parameter Description

Input

url

The url to navigate to

Example  Expand source

RegisterPageHandler

Registers a new page handler for use in detecting when pages that have automated actions associated with them are loaded and alerting the addon script to respond to the page load.

Parameter Direction

Parameter Name

Parameter Description

Input

idType

The type of page handler matching that should be done against the given id.

Icon

A detailed description of the page handler types and how each works is listed in the Page Handlers section.

Input

id

The id to match against

Input

handlerName

The name of the Lua method that should be called when the page handler is invoked

Input

critical

Whether or not the page handler is considered a critical page handler, which should exist outside of the normal queue and should be checked every time the the system checks for a page match

Example  Expand source

ShowDevTools

Open developer tools in it's own window. The developer tools are useful when authoring and debugging an addon that uses the chromium web browser.

Example  Expand source

StartPageWatcher

Starts the page watcher, which will check the page handler queue (and critical page handlers) at an interval defined by checkInterval. If no match is found when the maxWatchTime is reached, the handler will stop. This is primarily used on pages that use AJAX or other similar methods to make dynamic changes to the page content without actually causing the page to fully change. In these cases, a page watcher can be started before performing an action that will cause a page update so that the new page state can be checked.

Parameter Direction

Parameter Name

Parameter Description

Input

checkInterval

The interval, in milliseconds, that the page handler queue should be checked

Input

maxWatchTime

The maximum amount of time,in milliseconds, the page watcher should run before stopping

Example  Expand source

StopPageWatcher

Stops the page watcher so that it will not perform any more checks on the page handler queue.

Example  Expand source

Scripting Bridge

The scripting bridge allows for the browser to communicate with the addon system. 

ExecuteAddonFunction

The executeAddonFunction is designed to allow javascript on the page to utilize lua functions that are within the addon.

Icon

Since javascript is case-sensitive, ensure that you call the function exactly as seen below.

ParameterTypeDescription
functionNamestringThe lua function to be called
argsobject[]The arguments to be passed to the lua function
Example  Expand source