Contents

removeScriptMessageHandler(forName:)

Uninstalls the custom message handler with the specified name from your JavaScript code.

Declaration

func removeScriptMessageHandler(forName name: String)

Parameters

  • name:

    The name of the message handler to remove. If no message handler with this name exists in the user content controller, this method does nothing.

Discussion

Use this method to remove a message handler that you previously installed using the add(_:name:) method. This method removes the message handler from the page content world — that is, the content world available from the page property of WKContentWorld. If you installed the message handler in a different content world, this method doesn’t remove it.

See Also

Adding and Removing Message Handlers