Ifmessageport, Ifuserdata – BrightSign Object Reference Manual (FW 5.1) User Manual

Page 74

Advertising
background image

66

PostJSMessage(data As roAssociativeArray) As Boolean: Posts a collection of key:value pairs to the
BSMessagePort JavaScript class (see the JavaScript Objects for BrightScript tech note for more details). This
method does not support passing nested associative arrays.

StartInspectorServer(port As Integer) As Boolean: Enables the JavaScript console, which allows
you to debug JavaScript applications while a webpage is running. To access the console, navigate to the player IP
address at the specified port number. See

this page

for documentation relating to the JavaScript console.

SetUserAgent(user_agent As String) As Boolean: Changes the default user-agent string reported by
WebKit.
Example: The following is a default user-agent string sent by an XD1230.
BrightSign/4.7.85.2-8-g1a6e6f6-td-debug (XD1230) Mozilla/5.0 (compatible; Linux
mips) AppleWebKit/537.4 (KHTML, like Gecko)
Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/537.4


The ifMessagePort interface provides the following:

SetPort (a As Object)


The ifUserData interface provides the following:

SetUserData(user_data As Object): Sets the user data that will be returned when events are raised.

GetUserData() As Object: Returns the user data that has previously been set via SetUserData(). It will
return Invalid if no data has been set.


An roMessagePort can be attached to an roHtmlWidget. It will then receive roHtmlWidgetEvent objects when something
happens to the parent widget. An roAssociativeArray functions as the payload of the roHtmlWidgetEvent, and the payload
can be retrieved using the

GetData() method. Within the associative array, the reason key identifies the cause of the

event. The

reason key can return the following values:

load-started: The WebKit has started loading a page.

Advertising