If an roMessagePort is attached to an roHtmlWidget, it will receive roHtmlWidgetEvent objects when something happens to the parent roHtmlWidget instance.
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.
GetData() As roAssociativeArray
Returns the event data as an associative array with the following key/value pairs:
[string] reason: The cause of the event, which can be one of the following:
"load-started": The HTML widget has started loading a page.
"load-finished": The HTML widget completed loading a page.
"load-error": The HTML widget failed to load a page. Use the
urikey to identify the failing resource and the
messagekey to retrieve some explanatory text.
"download-request": The HTML widget instance has received a download request. The Chromium instance does not process download requests for MIME types it doesn't recognize (e.g. PDFs); instead, it passes this event, along with the
urlparameters to the BrightScript autorun for processing.
"new-window-request": The HTML widget instance has received a request to open a URI in a new window. This request will normally come from HTML anchors with
Window.open()method. The requested URI is specified in the
[string] uri: The URI of the failing resource or new-window request (applicable for
[string] message: Explanatory text related to the load failure (applicable for
[string] mime-type: The MIME type of the download request (applicable for
[string] url: The URL of the download request (applicable for
The following event loop waits for an HTML widget event. If the event indicates that a PDF download request has been received, the script passes the relevant data to a CreatePdfRenderer() function that is not defined here: