UserMessage

Added in version 2.28.

class UserMessage(**properties: Any)

Superclasses: InitiallyUnowned, Object

Message that can be sent between the UI process and web process extensions.

A WebKitUserMessage is a message that can be used for the communication between the UI process and web process extensions. A WebKitUserMessage always has a name, and it can also include parameters and UNIX file descriptors. Messages can be sent from a WebContext to all web process extensions, from a web process extension to its corresponding WebContext, and from a WebView to its corresponding WebKitWebPage (and vice versa). One to one messages can be replied to directly with send_reply().

Constructors

class UserMessage
classmethod new(name: str, parameters: Variant | None = None) UserMessage

Create a new UserMessage with name.

Added in version 2.28.

Parameters:
  • name – the message name

  • parameters – the message parameters as a Variant, or None

classmethod new_with_fd_list(name: str, parameters: Variant | None = None, fd_list: UnixFDList | None = None) UserMessage

Create a new UserMessage including also a list of UNIX file descriptors to be sent.

Added in version 2.28.

Parameters:
  • name – the message name

  • parameters – the message parameters as a Variant

  • fd_list – the message file descriptors

Methods

class UserMessage
get_fd_list() UnixFDList | None

Get the message list of file descritpor.

Added in version 2.28.

get_name() str

Get the message name.

Added in version 2.28.

get_parameters() Variant | None

Get the message parameters.

Added in version 2.28.

send_reply(reply: UserMessage) None

Send a reply to an user message.

If reply is floating, it’s consumed. You can only send a reply to a UserMessage that has been received.

Added in version 2.28.

Parameters:

reply – a UserMessage to send as reply

Properties

class UserMessage
props.fd_list: UnixFDList

The UNIX file descriptors of the user message.

Added in version 2.28.

props.name: str

The name of the user message.

Added in version 2.28.

props.parameters: Variant

The parameters of the user message as a Variant, or None if the message doesn’t include parameters. Note that only complete types are allowed.

Added in version 2.28.