ScriptMessageRequest QML Type

The context of a message sent to a user script More...

Import Statement: import com.canonical.Oxide 1.15
Instantiates: OxideQQuickScriptMessageRequest

Properties

Detailed Description

ScriptMessageRequest represents the context of a message sent to a user script. The application can provide reply and error callbacks by setting the onreply and onerror callbacks accordingly.

Property Documentation

onerror : value

The error callback. This will be invoked with 2 arguments in the event of an error occuring with the message that the application sent.

The first argument will be an error code, with the following possible values:

ConstantDescription
ScriptMessageRequest.ErrorInvalidContextThe frame that the message was sent to does not have a JS context with the specified ID.
ScriptMessageRequest.ErrorUncaughtExceptionThe message handler provided by the user script threw an exception. Details of the exception will be provided in the second argument.
ScriptMessageRequest.ErrorNoHandlerThere was no handler for the message.
ScriptMessageRequest.ErrorHandlerReportedErrorUse of this is discouraged now.
ScriptMessageRequest.ErrorHandlerDidNotRespondThe message was successfully delivered to a handler provided by the user script, but it failed to respond.

onreply : value

The reply callback. This will be invoked with a single argument (the message payload, which is application defined) when the user script replies to the message that the application sent it.