UserContentManager.registerScriptMessageHandlerWithReply

Registers a new user script message handler in script world with name world_name.

Different from webkit.user_content_manager.UserContentManager.registerScriptMessageHandler, when using this function to register the handler, the connected signal is script-message-with-reply-received, and a reply provided by the user is expected. Otherwise, the user will receive a default undefined value.

If null is passed as the world_name, the default world will be used. See webkit.user_content_manager.UserContentManager.registerScriptMessageHandler for full description.

Registering a script message handler will fail if the requested name has been already registered before.

The registered handler can be unregistered by using webkit.user_content_manager.UserContentManager.unregisterScriptMessageHandler.

class UserContentManager
bool
registerScriptMessageHandlerWithReply
(
string name
,
string worldName = null
)

Parameters

name string

Name of the script message channel

worldName string

the name of a #WebKitScriptWorld

Return Value

Type: bool

true if message handler was registered successfully, or false otherwise.